Beispiel #1
0
 public HttpResponseMessage Post(ProspectCreateViewModel model)
 {
     if (ModelState.IsValid)
     {
         var item = _service.Execute(model.ToCommand());
         return(Accepted(new { created = item.RowsAffected, errors = item.Errors }));
     }
     return(Bad(ModelState));
 }
Beispiel #2
0
        public static ProspectCreateCommand ToCommand(this ProspectCreateViewModel model)
        {
            return(new ProspectCreateCommand()

            {
                ProspectID = Guid.NewGuid(),
                ProspectName = model.ProspectName,
                ProspectType = model.ProspectType,
                Closed = model.Closed,
                AdditionalInfo = model.AdditionalInfo
            });
        }