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.

Zain Nabi
  • 1
  • 1

1 Answers1

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

  • ,Exactly so. Why manipulate the code first classes if the property is not being used? It should be in the business logic layer – Zain Nabi Jul 27 '22 at 08:33
  • 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 – Stefano Buzzoni Jul 27 '22 at 09:06