private void DoSomeDataAccess(AddFoldRequest request) { var testers = _unitOfWork.PersonRepository.Future( new PersonNameSpecification("test1") .Or(new PersonNameSpecification("test2")) .Or(new PersonNameSpecification("test3"))); }
public string AddAbsence(AddFoldRequest request) { var fold = AutoMapper.Mapper.Map <AddFoldRequest, Absence>(request); DoSomeCallbacks(request); DoSomeDataAccess(request); return(DateTime.Now.ToLongTimeString()); }
private void btnSubmit_Click(object sender, EventArgs e) { var addFold = new AddFoldRequest { Start = dateTimePicker1.Value, End = dateTimePicker2.Value, PersonId = 1, Description = Text }; _client.AddAbsenceAsync(addFold); _client.SearchAsync(new List <CompositeSpecification>()); btnSubmit.Enabled = false; toolStripStatus.Text = @"Status"; }
private void DoSomeCallbacks(AddFoldRequest request) { var seed = new Random().Next(1000); var sleep = new Random(seed).Next(500, 3000); var channel = OperationContext.Current .GetCallbackChannel <IAbsenteeismbeServiceCallback>(); channel.OnCallback(string.Format("client {0} sleeping {1} ms", request.Description, sleep)); Thread.Sleep(sleep); channel.OnCallback(string.Format("client {0} adding {1} successfull and sleeping back for {2}", request.Description, request.PersonId, sleep)); Thread.Sleep(sleep); }