public void it_should_increment_like_count() { var employee = _service.Get(1); int oldLikeCount = employee.Employee.Likes; _service.LikeReceived(1).Wait(); var updatedEmployeee = _service.Get(1); int newLikeCount = updatedEmployeee.Employee.Likes; Assert.AreEqual(oldLikeCount, newLikeCount - 1); }
public void Test() { IStaffService staffService = DvConnection.ObjectContext.GetService <IStaffService>(); List <StaffEmployee> list = new List <StaffEmployee> { staffService.Get(new Guid("15fd1862-a815-42c1-9ed9-b5f3590ef0a9")), staffService.Get(new Guid("4eec9347-4048-4475-9263-1aa8a298f391")), staffService.Get(new Guid("e1509ec6-67b3-46c3-9699-c57c14ee7a70")) }; var adm = staffService.Get(new Guid("4eec9347-4048-4475-9263-1aa8a298f391")); var index = list.IndexOf(adm); if (list.Count == 0 || index == list.Count - 1) { return; } if (index != list.Count - 1) { list.Remove(adm); } list.Insert(list.Count, adm); }
public async Task <JsonResult> GetList(AuthentyPara para, int page = 0, int rows = 20) { try { return(await Task.Run(() => { para.PageNumber = page - 1; para.PageSize = rows; para.OrgId = LoginInfo.Org.Id; para.RoleId = LoginInfo.Role; var rlt = _authentyService.GetList(para, out var count); var data = rlt.MapTo <List <AuthentyModel> >(); data.ForEach(m => m.AuditResult = _customerService.Get(m.Id).AuditResult); data.ForEach(m => m.SalesMan = _staffService.Get(m.SalesMan)?.Name); data.ForEach(m => m.AuditResultDesc = _customerService.Get(m.Id)?.AuditResult.GetDescription()); return new JsonResult(new { total = count, rows = data }); })); } catch (Exception e) { Logger.Error("authentyController GetList Error", e); return(new JsonResult(new { total = 0, rows = "" })); } }
public IActionResult Get([FromQuery] int id) { var response = _staffService.Get(id); return(Ok(response)); }
// GET: api/Priorities public IEnumerable <Staff> Get() { return(_staffService.Get()); }
/// <summary> /// 获取单个数据 /// </summary> /// <param name="id">账户名/id</param> /// <returns></returns> public StaffDto Get(string id) { return(_staffService.Get(id)); }
public StaffInfo Get(int id, bool @readonly = false) { return(_service.Get(id, @readonly)); }