private static Eu.Xroad.UsFolkV3.Producer.NameParam NameParam(NameParam param) { return(new Eu.Xroad.UsFolkV3.Producer.NameParam() { first = param.First, last = param.Last }); }
private void TestAddPersonToCommunityByNameAndDateOfBirth() { Console.WriteLine("# TestAddPersonToCommunityByNameAndDateOfBirth"); var communityPerson = PrivateCommunityClient().AddPersonToCommunity( NameParam.Create("Karius", "Davidsen"), new DateTime(2008, 4, 30) ); PrintCommunityPerson(communityPerson); }
private void TestGetPersonMediumByNameAndDateOfBirth() { Console.WriteLine("# TestGetPersonMediumByNameAndDateOfBirth"); var person = MediumClient().GetPerson( NameParam.Create("Karius", "Davidsen"), new DateTime(2008, 4, 30) ); PrintPerson(person); }
public async Task <Result> Post([FromBody] NameParam model) { _unitRepository.Add(new Unit { Name = model.Name }); await _unitRepository.SaveChangesAsync(); await ClearCache(); return(Result.Ok()); }
private void TestAddPersonToCommunityByNameAndAddress() { Console.WriteLine("# TestAddPersonToCommunityByNameAndAddress"); var communityPerson = PrivateCommunityClient().AddPersonToCommunity( NameParam.Create("Karius", "Davidsen"), AddressParam.Create("Úti í Bø", HouseNumber.Create(16), "Syðrugøta") ); PrintCommunityPerson(communityPerson); }
private void TestGetPersonMediumByNameAndAddress() { Console.WriteLine("# TestGetPersonMediumByNameAndAddress"); var person = MediumClient().GetPerson( NameParam.Create("Karius", "Davidsen"), AddressParam.Create("Úti í Bø", HouseNumber.Create(16), "Syðrugøta") ); PrintPerson(person); }
public async Task <Result> Put(int id, [FromBody] NameParam model) { var unit = await _unitRepository.FirstOrDefaultAsync(id); if (unit == null) { return(Result.Fail("单位不存在")); } unit.Name = model.Name; unit.UpdatedOn = DateTime.Now; await _unitRepository.SaveChangesAsync(); await ClearCache(); return(Result.Ok()); }
public PersonSmall GetPerson(NameParam name, AddressParam address) { Util.RequireNonNull(name, "name"); Util.RequireNonNull(address, "address"); var method = new Eu.Xroad.UsFolkV3.Producer.GetPersonSmallByNameAndAddress() { request = Mapper.Mapper.NameAndAddressParam(name, address) }; var request = new Eu.Xroad.UsFolkV3.Producer.GetPersonSmallByNameAndAddressRequest() { client = clientHeader, service = ServiceHeader(method.GetType()), userId = userIdHeader, id = IdHeader(), issue = issueHeader, protocolVersion = protocolVersionHeader, GetPersonSmallByNameAndAddress = method }; return(Call( () => webService.GetPersonSmallByNameAndAddress(request), r => PersonMapper.Map(r.GetPersonSmallByNameAndAddressResponse) )); }
public PersonSmall GetPerson(NameParam name, DateTime dateOfBirth) { Util.RequireNonNull(name, "name"); Util.RequireNonNull(dateOfBirth, "dateOfBirth"); var method = new Eu.Xroad.UsFolkV3.Producer.GetPersonSmallByNameAndDateOfBirth() { request = Mapper.Mapper.NameAndDateOfBirthParam(name, dateOfBirth) }; var request = new Eu.Xroad.UsFolkV3.Producer.GetPersonSmallByNameAndDateOfBirthRequest() { client = clientHeader, service = ServiceHeader(method.GetType()), userId = userIdHeader, id = IdHeader(), issue = issueHeader, protocolVersion = protocolVersionHeader, GetPersonSmallByNameAndDateOfBirth = method }; return(Call( () => webService.GetPersonSmallByNameAndDateOfBirth(request), r => PersonMapper.Map(r.GetPersonSmallByNameAndDateOfBirthResponse) )); }
public static Eu.Xroad.UsFolkV3.Producer.NameAndDateOfBirthParam NameAndDateOfBirthParam(NameParam name, DateTime dateOfBirth) { return(new Eu.Xroad.UsFolkV3.Producer.NameAndDateOfBirthParam() { name = NameParam(name), dateOfBirth = dateOfBirth.ToISOString() }); }
public static Eu.Xroad.UsFolkV3.Producer.NameAndAddressParam NameAndAddressParam(NameParam name, AddressParam address) { return(new Eu.Xroad.UsFolkV3.Producer.NameAndAddressParam() { name = NameParam(name), address = AddressParam(address) }); }