Core project

 

 

?????? ???????? , ?? ?????? ?????? ?? ???? ??????? , ?? ??????? ???? ??? ??? ?????? Web layer , Infrastructure layer , ????? ??? ??? ?????? .

 

 

?? ????? ?? ?????? ???????? core  ?? ???? ??? ?? ???? ???? .

?????? ?? ????? Core layer  ??? ?????? :

???? ???????? (Domain Entities)

?????? ?????????? ??????? (Repositories interfaces)

??? ?? ?? ???? ?? ?????? ??? ????? ?????? , ??? :

Reference of the ORM like LINQ to SQL or EF

  1. ORM like LINQ to SQL or EF
  2. ADO.NET libraries
  3. Entity Framework .

Create Entity

?????? , Entity  ????? ?????? BloodDonor entity class. .

 

?? ???? ????? ??? ?????? , ????? ????? , ??? ??? ???????? ??????? ?? ??? , ?? ???? ?????? ???? ?????? , ?????? ?? ???????  .

????? ???????? ??????? , ???? ??? ?? ????? ???? :

  1. System.ComponentModel.DataAnnotations
  2. Entity Framework fluent API.

??? ????????? ???????? , ???? ?????? . ?? ??? ???? ?????? ???????? ???? ?? ????? ?????? ??? EntityFramework , ??? ???? ??????? DataAnnotations  .

???????? DataAnnotations  ?? ?????? ?????? ?????? , ??? ????? .

System.ComponentModel.DataAnnotations

 

??? ????? BloodDonor entity class ?? DataAnnotations  .

?????? ??????? ????? ?????? ???????? ??????? repository interface

Repository interface

??? ???? ????? ?????????? repository  ,   ??? ?????????? ???? ?? ??????? ???? ?????? ?????? ???????? ??? ??????? ??? ?? ???? ???? .

?? ?????? ?????????? repository interface , ??? ??? ????? ?? ?????? ????? ???????? ???? ??????? .

 

??? ???????? ?? ????? ?? ??????? ?????????? ?? ?????? ,?????? ??????? ????? ???? ??????? infrastructure project .

Infrastructure project

 

?? ????? ?????? ??????? ,??? ???? ????? ???????? ???????? ???? ???????.

  1. Database operation
  2. Accessing outside service
  3. Accessing File systems

 

?????? ?? ???? ???????? ??????? ???? ?? ????? ?????? ???????. ??? ??????  Entity Framework ?????? ?????? ????? ????????. ??? ???? ??  Entity Framework code first .

 ???? ??? ????? ?????? ??????? ???????:

  1. Create the data context class
  2. Implement the repository class
  3. Create the database initializer class

??? ????? data context class , ??? ????? ???? Entity Framework , ?? Nuget Package Manager .

DataContext class
 

????? ?????? Data context class  .

 

Connection string

< connectionStrings >< add name = "BloodDonorContextConnectionString" connectionString = "Data Source= LocalDb)\v11.0;Initial Catalog=BloodDonors;Integrated Security=True;MultipleActiveResultSets=true" providerName = "System.Data.SqlClient" / >< /connectionStrings>

 

???? ......

 

Source:c-sharpcorner,debugmode



Share

Comments