Esempio n. 1
0
 public Domain.Entities.RatingType Create(Domain.Entities.RatingType ratingType)
 {
     using (var entities = new Entities())
     {
         var newRatingType = entities.RatingType.Add(Mapper.Map <DataAccess.Model.RatingType>(ratingType));
         entities.SaveChanges();
         return(Mapper.Map <Domain.Entities.RatingType>(newRatingType));
     }
 }
Esempio n. 2
0
 public void Edit(Domain.Entities.RatingType newRatingType)
 {
     using (var entities = new Entities())
     {
         var ratingType = this.GetRatingType(newRatingType.Id);
         ratingType.Name = newRatingType.Name;
         entities.Entry(Mapper.Map <DataAccess.Model.RatingType>(ratingType)).State = EntityState.Modified;
         entities.SaveChanges();
     }
 }
Esempio n. 3
0
 public static RatingTypeModel FromDomainModel(Domain.Entities.RatingType domainRatingType)
 {
     return(Mapper.Map <RatingTypeModel>(domainRatingType));
 }