public void CreatePerson(CreatePersonInput input) { person = new Person { Name = input.Name, EmailAddress = input.EmailAddress }; _personRepository.Insert(person); }
public void CreatePerson(CreatePersonInput input) { Person person = new Person { Name = input.Name }; person = _personRepository.Insert(person); }
public async Task CreatePerson(CreatePersonInput input) { //if (await FeatureChecker.IsEnabledAsync("CreatePerson")) //{ // throw new AbpAuthorizationException("You don't have this feature: CreatePerson"); //} var person = ObjectMapper.Map <Person>(input); await _personRepository.InsertAsync(person); }
public CreatePersonOutput CreatePerson(CreatePersonInput input) { var person = Mapper.Map <Person>(input); _personRepository.InsertAndGetId(person); return(new CreatePersonOutput { Person = Mapper.Map <PersonDto>(person) }); }
//private IRepository<Person> _personRepository; ////constructor injection. ////PersonAppService does not know which classes implement IPersonRepository or how it is created. ////When an PersonAppService is needed, we first create an IPersonRepository and pass it to the constructor of the PersonAppService //public PersonAppService(IRepository<Person> personRepository) //{ // _personRepository = personRepository; //} public void CreatePerson(CreatePersonInput input) { // Logger.Debug("IChecking if person excists with email address..."); // var person = _personRepository.FirstOrDefault(p => p.EmailAdress == input.EmailAddress); // if (person != null) // { // throw new UserFriendlyException("There is already a person with given email address"); // } // Logger.Debug("Inserting a new person with email address" + input.EmailAddress); // person = new Person{ Name = input.Name, EmailAddress = input.EmailAddress }; // _personRepository.Insert(person); // Logger.Debug("Person succefully added"); }
public async Task <CreatePersonPayload> CreatePersonAsync( [Service] IMongoCollection <Person> collection, CreatePersonInput input) { var person = new Person() { Name = input.Name, Addresses = input.Addresses, MainAddress = input.MainAddress }; await collection.InsertOneAsync(person); return(new CreatePersonPayload(person)); }
public async Task CreatePerson(CreatePersonInput input) { var person = input.MapTo <Person>(); await _personRepository.InsertAsync(person); }
public ActionResult Create(CreatePersonInput input) { _personAppService.CreatePerson(input); return(Content("ok")); }
public async Task CreatePersonAsync(CreatePersonInput input) { await _personRepository.InsertAsync(input.MapTo <Person>()); }
//Para poner permisos a un metodo // [AbpAuthorize(PermissionNames.Pages_Tenant_PhoneBook_CreatePerson)] public async Task CreatePerson(CreatePersonInput input) { var person = ObjectMapper.Map <Person>(input); await _personRepository.InsertAsync(person); }
internal static object MapTo <T>(CreatePersonInput input) { throw new NotImplementedException(); }
public async Task CreatePersonAsync(CreatePersonInput input) { await personRepository.InsertAsync(ObjectMapper.Map <Person>(input)); }
public int CreatePerson(CreatePersonInput dto) { var entity = Mapper.Map <Person>(dto); return(_personRepository.InsertAndGetId(entity)); }
public object Post(CreatePersonInput input) { var result = _service.CreatePerson(input); return(new { Id = result }); }
public Task CreatePerson(CreatePersonInput input) { throw new NotImplementedException(); }