Exemplo n.º 1
0
 public static Sphere GetORMEntity(this DALSphere DalEntity)
 {
     if (DalEntity == null)
     {
         throw new ArgumentNullException($"{DalEntity} is null!");
     }
     return(new Sphere()
     {
         Id = DalEntity.Id,
         Name = DalEntity.Name,
         //IdCategory = DalEntity.IdCategory,
     });
 }
Exemplo n.º 2
0
 public static BLLSphere GetBLLEntity(DALSphere dalEntity)
 {
     if (dalEntity == null)
     {
         throw new ArgumentNullException();
     }
     return(new BLLSphere()
     {
         Id = dalEntity.Id,
         Name = dalEntity.Name,
         Level = dalEntity.Level,
         CategoryName = dalEntity.CategoryName,
     });
 }
Exemplo n.º 3
0
 public IEnumerable <DALProgrammer> GetUsersWithSphere(DALSphere sphere)
 {
     return(context.Set <Programmer_Sphere>().Where(pr => pr.IdSphere == sphere.Id).Select(pr => pr.Programmer.GetDALEntity()));
 }
Exemplo n.º 4
0
 public void UpDate(DALSphere e)
 {
     context.Entry(e.GetORMEntity()).State = EntityState.Modified;
 }
Exemplo n.º 5
0
 public void Delete(DALSphere e)
 {
     context.Set <Sphere>().Attach(e.GetORMEntity());
     context.Set <Sphere>().Remove(e.GetORMEntity());
 }
Exemplo n.º 6
0
 public void Create(DALSphere e)
 {
     context.Set <Sphere>().Add(e.GetORMEntity());
 }