public async Task <IActionResult> Get() { var request = new GetSchoolRequest(); var response = await _mediator.Send(request); return(Ok(response)); }
// // public Task <GetSchoolResponse> GetSchoolAsync(GetSchoolRequest request) { // var client = new JsonServiceClient(Config.http); var task = client.GetAsync(request); return(task); // }
public async Task <SchoolResponse> ReadOnlyGetSchoolAsync(GetSchoolRequest request) { if (request == null) { throw new ArgumentNullException($"Request is null"); } var result = await _schoolRepository.ReadOnlyGetByIdAsync(request.Id); return(_schoolMapper.Map(result)); }
public GetSchoolResponse GetSchool(GetSchoolRequest request) { var response = new GetSchoolResponse(); var query = new GetOrganizationByIdQuery(request.SchoolID); var result = this._repository.ExecuteQuery(query); if (result.Status == Status.Success) response.Value = (School)result.Value; return response; }
public async Task getSchool_should_get_data(int id) { var schoolRequest = new GetSchoolRequest { Id = id }; var result = await _sut.ReadOnlyGetSchoolAsync(schoolRequest); result.ShouldNotBeNull(); result.Id.ShouldBe(id); result.Name.ShouldBe("WU"); result.Country.ShouldBe("Austria"); }
public object Get(GetSchoolRequest request) { OrmLiteConfig.DialectProvider = MySqlDialectProvider.Instance; IDbConnection db = _connectstring.OpenDbConnection(); List <School> schools = db.Select <School>( ); db.Close(); GetSchoolResponse res = new GetSchoolResponse() { Schools = schools }; return(res); }