Questions tagged [Entity Framework] (346)

1
answer

Why the EF core cannot compare DateTimeOffse?

Code like this ((a.DateOfRecive == null || b.DateOfRecive == null) || a.DateOfRecive.Value.Month == DateTimeOffset.Now.Month) or((a.DateOfRecive == null || b.DateOfRecive == null) || a.DateOfRecive.Value.Month == b.DateOfRecive.Value.Month) EF core 3.1; gives errorcould not be translated. Either rewrite the query in a form ...
Paris asked April 4th 20 at 13:28
2
answers

EF Core Download of three or more entities. How?

Good day! Prompt please, purely theoretically, is it possible to make the download many connected with the essence of data without the use of a binding nature? It turned out that there is a project with a database on mysql and make changes in the structure of the database I can't. :( I have an Employee who has the position ...
desmond62 asked April 3rd 20 at 23:58
0
answer

How to set the OnUpdate?

Can't find how to set OnUpdate(CASCADE) or via attributes or Fluent API. Scoured the Internet Database: Postgresql Package: Npgsql.EntityFrameworkCore.PostgreSQL Tried to ask by analogy in the generated migration .OnDelete(DeleteBehavior.Cascade), the method OnUpdate does not exist. Please tell me someone knows and that so...
jeffry asked April 3rd 20 at 23:43
3
answers

How to create ORM service .NET Core?

IN ASP .NET Framework is possible to create a database model "database first" and using the DataService to quickly make an ORM service. Further, using oData Unchase to create classes in the client program to work with the database through the service. How to do that in ASP .NET Core? PS. Already installed on the EF .NET C...
Amya_Row asked April 3rd 20 at 18:11
1
answer

How to transfer data?

the crux of the matter I wrote a C# app using Entity Framework to distribute the models, used the migration and thought that storage uses EF. So, now I want to transfer all the data in the SQL Server deployment, how to do it? In the application folder there is no files .mdb. I think that the app launches SQL Server Express
kathlyn_Kshlerin asked April 3rd 20 at 17:15
1
answer

What's the best algorithm/approach to traverse the tree structure using EntityFramework?

All kind time of day. You have the following structure: I.e. this data is stored in the database and the same tree model should come to the user on the UI. Sootvestvenno goal: to walk this structure and create on the basis of its model. At the moment it is the most clumsy: for each entity(table) is created a separate mapper...
waino9 asked April 3rd 20 at 17:11
3
answers

Entity Framework — do not need?

Not long ago I heard the opinion that "If for a long time, reliably and with the support Entity Framework. If a quick throw together something simple something ADO.NET". Time to discuss why people thinks it was not, but his point stuck with me, because I saw it a little differently. Eric Evans in his book "Object-oriented d...
Ryley_Schaden asked April 2nd 20 at 17:13
1
answer

Could you tell me the basic rules of work with migrations in asp.net?

Good day! Deal with migrations in Entity Framework .net. Give an example of metanite what I'm doing: https://metanit.com/sharp/entityframework/3.12.php In all of these manuals are marked the basic things that issues do not arise. But if we dig even this resource comments, it becomes clear that getting out is not the obvious...
Tatyana.Yundt asked April 2nd 20 at 16:42
1
answer

Added new field to a table but change its value can't, what to do?

Good day! I have the following situation: There's an app for DB ( and the app and the DB is not mine, so their structure is still poorly understand ), you must add one of the tables a new field, added it via SQL Management studio, then opened the project, went to the model database (a file with the extension .edmx) click RM...
Eddie75 asked April 2nd 20 at 16:00
1
answer

How to get a collection of students of a certain grade?

Code models:public class Grade { public Grade() { Students = new HashSet<Student>(); } [Key] public int GradeId { get; set; } public string GradeName { get; set; } public string Section { get; set; } public ICollection<Student> Students { get; set; } } public class Student { [Key] public int Id { get; se...
gretchen.Eichmann asked April 2nd 20 at 15:46