public void Edit(BlogUser entity)
        {
            var configKey_webapi_path = KeyChain.WebApiDataAccess_Endpoint_BlogUser_Edit;
            var query     = HttpUtility.ParseQueryString(string.Empty);
            var queryName = KeyChain.WebApiDataAccess_Endpoint_BlogUser_Edit_UriQuery_UserId;

            query[queryName] = entity.UserId.ToString();
            var requestUri = this.BuildUri(configKey_webapi_path, query.ToString());
            var httpMethod = HttpMethod.Put;
            var content    = JsonConvert.SerializeObject(entity);
            var authHeader = this.BuildAuthHeader();
            var request    = this.BuildHttpRequestMessage(requestUri, httpMethod, content, authHeader);
            var response   = _webApiDataAccess.SendRequest(request);

            response.EnsureSuccessStatusCode();
            request.Dispose();
            response.Dispose();
        }
Beispiel #2
0
 public void Edit(BlogUser entity)
 {
     _validator.ValidateBlogUser(entity);
     _dataAccessAdapter.Edit(entity);
 }
Beispiel #3
0
 public void Delete(BlogUser entity)
 {
     _validator.ValidateBlogUser(entity);
     _dataAccessAdapter.Delete(entity);
 }
Beispiel #4
0
 public void Add(BlogUser entity)
 {
     _validator.ValidateBlogUser(entity);
     _dataAccessAdapter.Add(entity);
 }
 private List <BlogUser> GetNewListWithoutBlogUser(List <BlogUser> listOfBlogUser, BlogUser entity)
 {
     return(listOfBlogUser
            .Where(blogUser =>
                   (blogUser.UserId.Equals(entity.UserId)) == false)
            .ToList());
 }
        public void Add(BlogUser entity)
        {
            var filePath = _configuration[KeyChain.FileDataAccess_BlogUser_DatabasePath];

            _fileDataAccess.WriteToDatabase(filePath, entity);
        }
 private bool UserExists(BlogUser bloguser)
 {
     return(bloguser != null);
 }