I'm attempting to map a class which looks like below but I'm getting an exception regarding the Facility.Projects property being an interface....The property Facility.Projects is of an interface type IProject. If it is a navigation property manually confi...
Recently Xamarin announced support for NetStandard (see ...https://releases.xamarin.com/stable-release-cycle-7-service-release-1/...) and the recently shipped Entity Framework Core supports NetStandard. There was a recent issue with the SQLite.Native pack...
OK, Google, I am not able to googling it. ...Documentation... says...The model for that context is then cached and is for all further instances of the context in the app domain. This caching can be disabled by setting the ModelCaching property on the give...
I want to load a list of objects from db using Entity Framework 6 and Eager loading. But Entity Framework instead uses lazy loading. I've used SQL profiler and the queries are executed when a property referring to the child entities is accessed.
By using ...
I am probably not thinking in the right direction. I am fairly new to Dependency Injection and ASP.Net Core....I have a ASP.Net core website, and one of the tasks is to import data from an excel sheet to a database that a user will upload. The excel sheet...
I have two entities with one-to-zero-or-one relation: ...Version... and ...ChangeLog.... The second one stores file with changelog (for example 'ReadMe.html'). ...public class Version
{
[Key]
public int Id { get; set; }
public string Name { g...
I am trying to implement the ...repository pattern... in ...asp core.... Everything seems to work fine with a few adjustments,except adding it to the controller:... public class HomeController : Controller
{
private IDocumentRepository _con...
In Entity Framework Core 1.0 when I do something like:...var products = _context.Products.ToList();
foreach (var prod in products)
{
prod.Status = 1;
}
_context.SaveChanges();
...I believe it will automatically update all products in the list to hav...
I'm just starting to play with EF core (using NPGSQL), and have noticed some strange behavior on how navigation properties are being loaded without expressly using an 'include'. An example I'm seeing:...ObjectA...ObjectA->List ObjectB | ObjectA->List Obje...
I am trying to use ...SQLite... in ...ASP.Net Core... with ...EntityFramework Core.......When I am in debug mode (With Visual Studio), everything is working fine....When I publish it, and I am trying to receive data, it is working....Data read controller ...
Today I did a larger data import into a firebird 2.5.6 database and I got this exception:...System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> Firebi...
I have a 1:0..1 relationship that I'd like to map with EF 6 using fluent API. The relation consists of a principal, which may or may not have a dependent. A dependent must always have a principal....In the principal, I need to have access to the Id of the...
I created Xamarin.Forms Windows UWP and Android application with shared project.
To both(UWP and Android) I imported latest stable NuGet packages:
Microsoft.EntityFramework version 1.0.0, Microsoft.EntityFramework.Sqlite version 1.0.0 and Xamarin.Forms 2....
I've added a separate Identification to the AspNetUsers table called NumericId that will serve along with the GUID like ID that ASP has for default....I've added the property as an additional property of the ApplicationUser class:...public class Applicati...
I have a form where I want to update an entity with a many-to-many relationship with another entity, and I'm trying to use the ...select... tag to create the ...MultiSelectList... control. I'm using ASP.NET Core 1.0 with Entity Framework....Say I have the...
I have a detached object which contains a collection. I'm attaching it using this code...EntityEntry dbEntityEntry = _context.Entry<T>(entity);
dbEntityEntry.State = EntityState.Modified;
...Detached object saves perfectly if I change most of the fields..
I am working with EF 6 and Lazy loading. ...class MainPrograme
{
static void Main(string[] args)
{
ProgramContext _dbContext = new ProgramContext();
_dbContext.Programs.Add(new Program
{
SecondProgram = new Sec...
I'm using dependency injection to register my DbContext in the controller of a ASP.NET MVC Core Application like this: ...public void ConfigureServices(IServiceCollection services) {
return new MyContext(connectionString); }
services.AddScoped...
I'm using ASP.NET EF Core with MySQL (Pomelo.EntityFrameworkCore.MySql driver). Cause such a context need some lines of specific configuration which the default DbContext with MSSQL doesn't have, I created a MySqlContext:...public class MySqlContext : DbC...