skip to Main Content

Asp.net – Easier way to select a string in EF Core?

I would like to get the value of @@SERVERNAME. The following code works: [Keyless] public class EntityString { public String Value { get; set; } = String.Empty; }; // inside MyDbContext.OnModelCreating modelBuilder.Entity<EntityString>(); // inside MyDbContext public IQueryable<EntityString> QueryServerName() => Set<EntityString>().FromSqlRaw("SELECT…

VIEW QUESTION
Back To Top
Search