0

I am firmly in the camp of being a database first developer. I believe there are pro's and cons' to each approach. However when creating a code first approach should the newly created classes have default values set?

E.g.

public DateTime DateCreated {get; set;} = DateTime.Now;

If so what is the need for an existing business logic layer when the above property is not being referenced anywhere in the controller or business layer methods.

Another point is the mere fact that if code first migrations are enabled on commented out code the column is dropped!

Data is precious.

1 Answer 1

0

Business logic layer works as a medium from presentation layer and data access layer, so if a request in the business layer points to your property it gets fetched by data layer and returned

Sign up to request clarification or add additional context in comments.

2 Comments

,Exactly so. Why manipulate the code first classes if the property is not being used? It should be in the business logic layer
I don't really know to be honest, I never used code first approach. You should try to post the question on software engineering section, maybe they can give you more infos

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.