public async Task <Result <Exception, Company> > CreateAsync(Company company) { EntityEntry <Company> newCompany = _context.Companies.Add(company); await _context.SaveChangesAsync(); return(newCompany.Entity); }
public async Task <Result <Exception, Profile> > CreateAsync(Profile entity) { EntityEntry <Profile> newEntity = _context.AgentProfiles.Add(entity); await _context.SaveChangesAsync(); return(newEntity.Entity); }
public async Task <Result <Exception, Agent> > CreateAsync(Agent agent) { agent.Password = agent.Password.GenerateHash(); EntityEntry <Agent> newAgent = _context.Agents.Add(agent); await _context.SaveChangesAsync(); return(newAgent.Entity); }