public IActionResult Post([FromBody] AddDataCollector command) { var dataCollector = _dataCollector.Get(command.Id); dataCollector.AddDataCollector(command); return(Ok()); }
public void Add([FromBody] AddDataCollector command) { Apply(command.Id, new DataCollectorAdded { Id = command.Id, FirstName = command.FirstName, LastName = command.LastName, Age = command.Age, Sex = command.Sex, NationalSociety = command.NationalSociety, PreferredLanguage = command.PreferredLanguage, MobilePhoneNumber = command.MobilePhoneNumber, Email = command.Email }); }
public void AddDataCollector(AddDataCollector command) { Apply(new DataCollectorAdded { Id = command.Id, FirstName = command.FirstName, LastName = command.LastName, YearOfBirth = command.YearOfBirth, Sex = (int)command.Sex, NationalSociety = command.NationalSociety, PreferredLanguage = (int)command.PreferredLanguage, RegisteredAt = DateTimeOffset.UtcNow //MobilePhoneNumber = command.MobilePhoneNumber, //Email = command.Email }); }
public IActionResult Post([FromBody] AddDataCollector command) { //TODO: This should be moved to domain project Apply(command.Id, new DataCollectorAdded { Id = command.Id, FirstName = command.FirstName, LastName = command.LastName, Age = command.Age, Sex = command.Sex, NationalSociety = command.NationalSociety, PreferredLanguage = command.PreferredLanguage, //MobilePhoneNumber = command.MobilePhoneNumber, //Email = command.Email }); return(Ok()); }