Questions tagged [Entity Framework] (346)

1
answer

How to insert new objects in EF?

Let's say I have 2 context with the same structure and I am updating data from one context to another. Somewhere updated, and the need to put in a brand new data from the preceding context with the preservation Id. Actually a question: For example, in the context of destination already has a User object that has a Reques...
kaitlin asked April 19th 20 at 12:00
0
answer

How to make a table to another table?

Hello, need help! You need to build a database "Custom" using model first principle EF. How do I join tables with CustomerHouse Company and Products. I just don't understand how to provide CustomerHouse - main table "Custom". If I were doing sql, then you can easily specify the foreign key (company) references to company(...
Helmer.Bechtel asked April 16th 20 at 11:09
0
answer

How to create a stored procedure using the Fluent API?

Tell me, I can do no migrations to execute arbitrary code in Fluent API, to create any stored procedure? Are there any alternatives to migration?
Donavon_Botsford57 asked April 8th 20 at 18:27
0
answer

How to load nested properties using EF Core with Expression?

Such situation: there is a method ListAsync in the method of the repository is implemented roughly like so: public virtual async Task<IEnumerable<TEntity>> ListAsync( params Expression<Func<TEntity, object>>[] includeProperties) { IQueryable<TEntity> query = this.QueryableEntities; if (inc...
Chesley asked April 8th 20 at 17:43
4
answers

The correct architecture when building Web applications?

Good afternoon. There was a desire to write for the workout app, which the idea will be ready for the big load, which will be easily expandable etc To find out and was selected Asp.Net core 3.xat the front Vue.js. To work with the database I used entity framework core. What else should I use for the best possible architectu...
Elmo.Schmidt40 asked April 8th 20 at 17:27
2
answers

How best to implement the validation class generated by Entity Framework th?

There is DB MS SQL and WPF project. To work with this database using Entity Framework Core. It is generated for each table the classes we will be interested in the class fellow - Employees. When you create a new employee before saving you want to check whether all fields are completed. Used MVVM pattern and create a ViewMo...
nikko asked April 8th 20 at 02:50
1
answer

Entity Framework Core how to add third-party option when loading data from database?

Develop a server on RAGE MP(multiplayer for GTA 5). Decided to use EntityFrameworkCore, but faced with such a problem. On this platform there is a Client class which you can use to manage the settings of the player and his character, I created an additional class PlayerData to make it easier to work with customer data, and ...
Lucienne asked April 7th 20 at 16:23
2
answers

How can you combine two Expression'a one to retrieve data from Entity Framework Core?

Hi! I have two expresen with the conditions that I want to combine into one expresen and feed in the Entity Framework Core. Expression<Func<Device, bool>> deviceTypeFilter = d => d.DeviceTypes == DeviceTypes.Camera; Expression<Func<Device, bool>> geolocationFilter = d => d.Latitude == 23.2; f...
alexanne_Koss64 asked April 7th 20 at 16:18
0
answer

Is it possible in the properties that are used in CodeFirst EF6 to add logic?

Is it possible in this way to use properties to generate the database in EF6? private ICollection<Ingredient> ingredients; public virtual ICollection<Ingredient> Ingredients { get => ingredients ?? (ingredients= new List<Ingredient>()); set { if (value == null) throw new ArgumentNullException("Ingre...
merle_McCullough asked April 7th 20 at 16:09
2
answers

Should there be EF Core migration in a repository?

Command dotnet ef migration add ... creates a migration file. Do I need to add these files to the git repository? What to do if you change providers database migrations?
Korey_Funk asked April 7th 20 at 10:59