Questions tagged [entity-framework]

An ORM built by Microsoft and is available as part of .Net framework 3.5 and later.

Filter by
Sorted by
Tagged with
-3
votes
1answer
38 views

How to store and query multi selection options?

An example would be an Automobile sales application where Autos are stored with their Make and FuelTypes. An application user would save their search criteria in a SearchCriteria table which would be ...
0
votes
1answer
37 views

Designing asp.net core web api to add sub classes/specialized objects

I have not worked with EF for a while. As an exercise, I am writing a core web api that allows keeping track of a user medias. A media can be a postcard, a photo album, a recording, a book... I would ...
0
votes
2answers
97 views

repository pattern, using the domain object as data access object

I'm very puzzled by a specific part of the repository pattern that seems simple but turn out to be tricky. I took this great explanation of this topic by Mosh Hamedani; it's a C# implementation of ...
1
vote
2answers
80 views

Should an AggregateRoot not be a database Entity?

TLDR: Does using DB objects as my AggregateRoot lead to bloated God objects. In comparison to the issues I see in using separate DbObjects and DDD objects. I'm trying to bring together my ...
0
votes
1answer
36 views

Move monolith to Event Streaming in one step or multiple steps?

I have been the sole developer on a project for the past eight years. Right now it's one big monolith, but at this point it's really three separate apps, and those really need to be broken down as ...
0
votes
0answers
38 views

Net Core: Solutions to Update History Tables in Application Design

Our company did not properly design Address Record Code Module. Developers are updating Address SQL table with Multiple Service Methods, and are not updating AddressHistory Sql table. They're asking ...
1
vote
1answer
118 views

Logging to database in ASP.NET Core Entity Framework Core application

I have an ASP.NET Core Entity Framework Core application and I want to implement my own custom logger. I don't want to use ready solutions like NLog or Serilog. I added a new class library project ("...
0
votes
0answers
37 views

Should I use a Web API between a client and Entity Framework?

I am creating a database that will keep track of my company's clients, and an app that will allow users inside the company to read/update/etc. the database. I'm using code-first EF Core to manage the ...
2
votes
3answers
115 views

Are methods a bad practice on .NET Core EF entity classes?

Say you have the following entity that represent an exact resource from a table, we're talking .NET Core with Entity Framework Core, code-first approach. public class Person { [Key] public ...
0
votes
1answer
97 views

Entity Framework and Domain Driven Design Testability

I'm using a DDD approach for the Domain classes. Although, I have a problem on my design, that I'm handling it now but didn't have a good idea to over tackle it. My Architecture is the follow one: - ...
2
votes
2answers
601 views

Is unit of work pattern really needed with repository pattern

I am trying to use EF6 with my project. I just watched Repository Pattern with C# and Entity Framework, Done Right | Mosh video. I understand the necessity of Repositories but I still don't understand ...
0
votes
0answers
28 views

How does GraphQL and EntityFramework work together consumer side

We are developing a graphql api for our DAL at work and I'm having trouble seeing how as a consumer of the api we can use our current model in a beneficial way. I'm developing a desktop app that uses ...
0
votes
2answers
133 views

Services injected with factories

I face an issue where I want to inject Entity Frameworks DbContext into a service class, in a WPF application. The problem is that the service classes are instantiated and contained by the view models....
0
votes
0answers
39 views

Implementing Core Data parent-child context relationship via Entity Framework

I'm working on porting an iOS app to Xamarin, where it's hoped that the Xamarin project will match as much of the logic and layout of the iOS project as possible. One big area that the iOS project ...
0
votes
1answer
31 views

data model design of a store net sales and earnings

I've designed my app so it stores the data of each sale in the following way: each order contains different products so for each product in an order a table stores the quantity(of the product) , net ...
0
votes
3answers
80 views

Need advice on reporting with big amounts of data

I have a monolith application in .net core 3.0 with entity framework core 3.0. using: a table with ~3 million records. Its structure is BusinessUnitId | ProfileId | Amount(it has more fields, but ...
1
vote
1answer
28 views

Pattern for schema split across sources

I was not sure how to title this question, but bear with me. My company is building a new product and for it we will use a third-party service (let's call it ENB for short) to be responsible for many ...
5
votes
1answer
720 views

Avoiding Repository pattern - implementing Onion Architecture with DbContext only

I am trying to follow the Onion Architecture to design my application where I have the following layers - Domain Layer: is the inner-most layer and defines repository interfaces Infrastructure ...
2
votes
1answer
83 views

Application Security Trimming vs Database Security Trimming

We have a fairly complex Meetings Management solution which would have one meeting to contain different agendas which would contain some tasks and also documents, etc. There are also different roles ...
0
votes
1answer
68 views

Best practice for populating a property of an entity object which requires a second database call

I'm running a commercial accounting software packages which uses a SQL server database. I've also developed a WPF application which is basically a slimmed down version of the commercial software. ...
1
vote
1answer
1k views

How to avoid circular references with EF Core and Global Query Filters?

We're working on building a multitenant application, and we're using Entity Framework Core as our base data provider. With EF Core, you can use Global Query Filters to define custom filters that apply ...
1
vote
0answers
39 views

“Add-On” Projects and ASP.NET Core with Entity Framework

I've created a .NET Core MVC product with Entity Framework, and am being tasked with creating "Add-on" products, which give CRUD operations to more tables, but use the same library functions and UI. ...
2
votes
2answers
124 views

Different types of account transactions

I'm working on a system where users have different types of 'Accounts' of the financial type. I'm struggling to come up with a design that works. Background A user has 2 types of accounts: A 'tab' ...
0
votes
0answers
42 views

How should I trigger notification generating methods and APIs?

I have .NET Core project, database is MSSQL with EF Core code first approach. I need to create a notification system, users should be notified both in interface and via mail. For this I'm creating ...
2
votes
3answers
476 views

DataAccess Layer coupling with Domain Layer

We have an issue with how the implementation of the Data Access layer (EF6 Includes more specifically), influences the behavior of our Domain layer. A theoretical example to illustrate: Application ...
2
votes
3answers
96 views

Choosing between derived classes and adding an additional property in entity framework

I have the following StudentGroup class: public class StudentGroup { [Key] public int Id { get; set; } //the set of peers who will review the work of the StudentGroup [ForeignKey("...
0
votes
1answer
125 views

Call library functions with varying number of inputs while keeping API simple

For a ASP.NET Core application, I'm using a library which performs calculations using objects that have a similar interface but their constructors use different inputs. The inputs are market prices ...
2
votes
2answers
233 views

Is making your ORM DAO a subclass of your Domain Model object a viable strategy?

I am trying to separate my domain model and associated business logic from my persistence model, particularly such that the domain model has no dependency on the ORM. One apparent way to do that was ...
1
vote
1answer
234 views

Split Data logic and domain logic in POCO class?

Say for example, in this mock bank ATM app solution, I have 3 projects: UI Console Domain Model (POCO) Persistence (Entity Framework for CRUD) Domain Model (POCO): I have 2 classes public class ...
1
vote
2answers
836 views

Should an ASP.NET Web API application use Entity Framework in the API controllers?

Im a bit confused about what is best practice when working with Entity Framework and ASP.NET Web API. I am working on a project that contains a iOS/Android app and an API the app will use to ...
0
votes
0answers
16 views

how to work with variable data structures and templates

I need users to be able to create an organization which will have some preset fields such as Name, Address, and Type. But depending on the type, the organization can have type-specific fields such as ...
0
votes
1answer
44 views

Use single table with lots of columns or break it out and use Views, when using Entity Framework Core

I am currently building a game series information site and have come to a design issue. I have a table called Abilities that would have character ability information in it. Depending on the game ...
0
votes
1answer
68 views

Venue Reservation System Logic Approach/Clarification

I hope this is the right place to ask since this is a programming related question. I’m developing a venue reservation app (similar to booking.com) and am almost done however I have 1 request for ...
1
vote
1answer
72 views

Architecture for independent modules writing in the same database

Let's say I have a database with a table called "invoices". Then I have a web application where users can manually create invoices against said table. I also have a desktop application that can ...
0
votes
1answer
97 views

Is a refresh token an entity or value object?

I have a User entity, which may have a RefreshToken (for authentication). Notes: A refresh token doesn't have "identity", but is related to a single user - it is only valid for that user. In the db ...
0
votes
0answers
134 views

Real-time application and RDBMS bottleneck

I'm currently developing a real-time application using .NET Core 2.2. Many IOT devices (could be up to 100) are concurrently sending messages via MQTT. These messages are parsed, elaborated to extract ...
1
vote
2answers
130 views

Deleting each row and re-adding when saving to database

I have a structure which looks like Person ID int Name nvarchar Phone ID int PersonId int Number nvarchar Make nvarchar Model nvarchar MultiSim bit One person can ...
1
vote
1answer
541 views

Updating sub-properties via Entity Framework

I was wondering how to updated nested objects/sub-properties when using Entity Framework. But to make things clear, let's start with an example. I have an object, which can own a number of other ...
2
votes
2answers
434 views

Dependency inversion vs repository pattern (app layer dependency on ORM)

Let's say we have an application layer with some command handler and we use an Entity Framework database context/ORM context in that handler. I would invert dependencies from the Entity Framework/...
-2
votes
4answers
2k views

Mocking dbContext vs Repository [closed]

I use entity framework with Repository Pattern. while searching for means of writing unit test cases that run isolated from the database I found some people mocking the database context and others ...
2
votes
4answers
3k views

Is Entity Framework Core slower than using ADO .NET and stored procedures?

I'm looking at designing some new software for work, and I have been using EF Core quite a bit in my personal projects. In my mind, EF Core generates queries for the underlying data provider which ...
0
votes
1answer
138 views

Does a 'leaky' repository implementation defeat the point of a repository?

I've seen some tutorials and examples of implementing a repository pattern, and I don't quite understand something. My impression was that the whole point of a repository pattern was to hide the ...
1
vote
1answer
581 views

Mock a PART of EF DbContext with Moq and/or InMemoryDbSet

This question is NOT about what's here: https://stackoverflow.com/questions/25960192/mocking-ef-dbcontext-with-moq and/or similar questions. I am well aware of that. Please, read the question before ...
1
vote
2answers
753 views

How to get ORM (Ef Core) Entities follow a DDD style . Which is the best approach?

I am considering mutliple options to face a problem. I want to develop software following DDD style. The problem arise when I have to define my entities and I am working with Entity Framework Core, ...
2
votes
0answers
53 views

How to join two sets of 6 tables and select the list into another set of 6 tables

A1 |__A2 |__A3 |__A4 |__A5 B1 |__B2 |__B3 |__B4 |__B5 C1 |__C2 |__C3 |__C4 |__C5 Given a list of A and a list of B, we want to "join" ...
5
votes
2answers
2k views

Should AutoMapper be used to Map from ViewModel back into Model?

Should AutoMapper be used to take data from ViewModel and save back into a database model? I know the opposite practice is good software practice: to have Automapper to extract database models, and ...
8
votes
2answers
3k views

Should Entity Framework 6 not be used with repository pattern?

So I am asking this after reading the following: Why shouldn't I use the repository pattern with Entity Framework?. It seems there is a large split of people who say yay and those that say nay. ...
0
votes
1answer
775 views

Entity Framework and static entity instances

I'm always having the problem on how to properly design having static entity instances and it being attached to Entity Framework's Dbcontext. For example, we have the following: using Microsoft....
-1
votes
1answer
32 views

where to put business constraints

We have a 3-tier architecture: Web, Business, Models using the MVC pattern. Models are Code-First using EF6. Currently we access the dbContext directly in our Controllers to query and save changes. We ...
1
vote
3answers
167 views

Tracking state on entity and unit-of-work pattern

In my web app I have a long running operation that is processing some entity in the background. The state of this process should be visible to the clients. During the processing the UI should show ...

1
2 3 4 5
8