当前位置: 首页>>代码示例>>C#>>正文


C# IUserService.GetUsers方法代码示例

本文整理汇总了C#中IUserService.GetUsers方法的典型用法代码示例。如果您正苦于以下问题:C# IUserService.GetUsers方法的具体用法?C# IUserService.GetUsers怎么用?C# IUserService.GetUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IUserService的用法示例。


在下文中一共展示了IUserService.GetUsers方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UsersViewModel

        public UsersViewModel(IUserService userService)
        {
            _userService = userService;

            Users = new List<User>(_userService.GetUsers());

            ExitCommand = new DelegateCommand<object>(AppExit, CanAppExit);
        }
开发者ID:cstrahan,项目名称:openpos,代码行数:8,代码来源:UsersViewModel.cs

示例2: UserModule

        public UserModule(IUserService userService, IUserRepository userRepository)
            : base("/api/v1/users")
        {
            Before += ctx =>
            {
                return null;
            };

            Get["/", true] = async (_, token) =>
            {
                var users = await userService.GetUsers();
                return users;
            };

            // ?fiter={condition}&limit={limit}&offset={offset}
            Get["/", ctx => ctx.Request.Url.Query != string.Empty, true] = async (_, token) =>
            {
                string filterString = this.Request.Query.filter;
                var filter = JsonConvert.DeserializeObject<dynamic>(filterString);

                int limit = this.Request.Query.limit;
                int offset = this.Request.Query.offset;

                var users = await userRepository.GetAsync(u => true, limit, offset, u => u.Name, true);
                return users;
            };

            Post["/", true] = async (_, token) =>
            {
                //using (var sr = new StreamReader(this.Request.Body))
                //{
                //    var json = sr.ReadToEnd();
                //}
                var user = this.Bind<User>();
                await userService.AddUser(user);
                return HttpStatusCode.Created;
            };

            Put["/{id}", true] = async (_, token) =>
            {
                var user = this.Bind<User>();
                bool success = await userRepository.UpdateAsync(user);
                return success ? HttpStatusCode.OK : HttpStatusCode.BadRequest;
            };

            Delete["/{id}", true] = async (_, token) =>
            {
                string id = _.id;
                bool success = await userRepository.DeleteAsync(_.id);
                return success ? HttpStatusCode.OK : HttpStatusCode.BadRequest;
            };

            Options["/"] = route => new Response();
        }
开发者ID:joeyulivecn,项目名称:NancyDemo,代码行数:54,代码来源:UserModule.cs

示例3: GetSupportersOfUpdate

 public IEnumerable<ApplicationUser> GetSupportersOfUpdate(int id, IUserService userService)
 {
     return userService.GetUsers().Join(UpdateSupportRepository.GetMany(g => g.UpdateId == id),
          u => u.Id,
          s => s.UserId,
          (u, s) => u);
 }
开发者ID:RetinaInc,项目名称:SocialGoal,代码行数:7,代码来源:UpdateSupportService.cs

示例4: SearchUserForGroup

 public IEnumerable<ApplicationUser> SearchUserForGroup(string searchString, int groupId, IUserService userService, IGroupInvitationService groupInvitationService)
 {
     var users = from u in userService.GetUsers(searchString)
                 where !(from g in GetGroupUsersByGroup(groupId) select g.UserId).Contains(u.Id) &&
                 !(groupInvitationService.IsUserInvited(groupId, u.Id))
                 select u;
     return users;
 }
开发者ID:RetinaInc,项目名称:SocialGoal,代码行数:8,代码来源:GroupUserService.cs

示例5: SearchUserToSupport

 public IEnumerable<ApplicationUser> SearchUserToSupport(string searchString, int goalId, IUserService userService, ISupportInvitationService supportInvitationService, string userId)
 {
     var users = from u in userService.GetUsers(searchString)
                 where u.Id != userId && !(from g in GetSupporForGoal(goalId) select g.UserId).Contains(u.Id) &&
                 !(supportInvitationService.IsUserInvited(goalId, u.Id))
                 select u;
     return users;
 }
开发者ID:RetinaInc,项目名称:SocialGoal,代码行数:8,代码来源:SupportService.cs


注:本文中的IUserService.GetUsers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。