public Pesticide Post <V>(PesticidePostCommand obj) where V : AbstractValidator <Pesticide> { Pesticide o = new Pesticide() { Id = Guid.NewGuid(), ActivePrinciple = obj.ActivePrinciple, CommercialName = obj.CommercialName, Date = obj.Date, DoseL = obj.DoseL, Hour = obj.Hour, Lack = obj.Lack, Lot = obj.Lot, Sytem = obj.System, PesticideType = obj.PesticideType }; Validate(o, Activator.CreateInstance <V>()); repository.Insert(o); return(o); }
public void Post([FromBody] PesticidePostCommand value) { var pesticide = service.Post <PesticideValidator>(value); }