public IHttpActionResult GetAllDomains() { List <DomainsDT> res = DomainsDT.ConvertToDto(DB.Domains.ToList()); return(Ok(res)); //DB.Configuration.ProxyCreationEnabled = false; //return Ok(DB.Domains); }
public IHttpActionResult AddField(DomainsDT domainsDT) { Domains D = domainsDT.ConvertToDomains(); DB.Domains.Add(D); DB.SaveChanges(); int ND = DB.Domains.First(x => x.Name == D.Name).Id; return(Ok(ND)); }