Exemplo n.º 1
0
        public async Task <UserModel> GetUserById(int UserId)
        {
            const string sql = @"SELECT UserAccount.*,Roles.* FROM UserAccount JOIN UserRoles on UserAccount.Id = UserRoles.UserId JOIN Roles on UserRoles.RoleId = Roles.RoleId WHERE UserAccount.Id = @UserId";

            return(await db.LoadSingleData <UserModel>(sql, new { UserId }));
        }
        public async Task <MenuInfo> GetMenuDataById(int MenuId)
        {
            const string query = @"SELECT * FROM Menu WHERE MenuId = @MenuId";

            return(await db.LoadSingleData <MenuInfo>(query, new { MenuId }));
        }