Example #1
0
 /// <summary>
 ///     Add entity.
 /// </summary>
 /// <param name="arg"></param>
 /// <returns></returns>
 public Response <Guid> Add(PST.Domain.FFP arg)
 {
     P.CheckArgNotNull(arg, "arg", "arg cannnot be null.");
     using (var context = new Entities())
         using (IUnitOfWork uow = new UnitOfWork(context))
         {
             var entity = AutoMapperBootstrap.M.Map <PST.Data.FFP>(arg);
             AddAssignment(arg, entity);
             uow.FFPRepository.Add(entity);
             uow.Commit();
             return(Response <Guid> .Succeed(entity.Id));
         }
 }
Example #2
0
 /// <summary>
 ///     Update entity.
 /// </summary>
 /// <param name="arg"></param>
 /// <returns></returns>
 public Response Update(PST.Domain.FFP arg)
 {
     P.CheckArgNotNull(arg, "arg", "arg cannnot be null.");
     using (var context = new Entities())
         using (IUnitOfWork uow = new UnitOfWork(context)){
             var exist = uow.FFPRepository.GetById(arg.Id);
             if (exist == null)
             {
                 return(Response.Failed("您要更新的数据不存在。"));
             }
             AutoMapperBootstrap.M.Map(arg, exist);
             UpdateAssignment(arg, exist);
             uow.Commit();
             return(Response.Succeed());
         }
 }
Example #3
0
 private void UpdateAssignment(FFP src, Data.FFP dest)
 {
 }
Example #4
0
 private void AddAssignment(FFP src, Data.FFP dest)
 {
 }