Beispiel #1
0
 public void Create(Domain.Entities.ActionType actionType)
 {
     using (var entities = new Entities())
     {
         entities.ActionType.Add(Mapper.Map <DataAccess.Model.ActionType>(actionType));
         entities.SaveChanges();
     }
 }
Beispiel #2
0
 public void Edit(Domain.Entities.ActionType newActionType)
 {
     using (var entities = new Entities())
     {
         var actionType = this.GetActionType(newActionType.Id);
         actionType.Name         = newActionType.Name;
         actionType.Scores       = newActionType.Scores;
         actionType.RatingTypeId = newActionType.RatingTypeId;
         entities.Entry(Mapper.Map <DataAccess.Model.ActionType>(actionType)).State = EntityState.Modified;
         entities.SaveChanges();
     }
 }
Beispiel #3
0
 public static ActionTypeModel FromDomainModel(Domain.Entities.ActionType domainActionType)
 {
     return(Mapper.Map <ActionTypeModel>(domainActionType));
 }