public void Registered(AuthorCreation creation) { this._creation = creation; if (this._peiceID == null) { } this._peiceID = string.Empty; this.OnRegistered(); }
public bool Create(AuthorCreation creation, out AuthorPeice peice) { if (this.creator == null) { peice = null; return false; } peice = this.creator(creation, this); return peice; }
public bool Create(AuthorCreation creation, out AuthorPeice peice) { if (this.creator == null) { peice = null; return(false); } peice = this.creator(creation, this); return((bool)peice); }
public async Task <Guid> AddAuthorAsync(AuthorCreation model) { var author = _mapper.Map <Author>(model); _repository.Add(author); await _unitofWork.SaveChangesAsync(); return(author.Id); }
public async Task <IActionResult> AddAuthor([FromBody] AuthorCreation model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var id = await _service.AddAuthorAsync(model); return(CreatedAtRoute("GetAuthor", new { id = id }, await _service.GetAuthorAsync(id))); }
public async Task <Author> EditAuthorAsync(Guid id, AuthorCreation model) { var author = await GetAuthorAsync(id); if (author != null) { author.FirstName = model.FirstName; author.LastName = model.LastName; } return(author); }
public async Task <IActionResult> EditAuthor(Guid id, AuthorCreation model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var author = await _service.EditAuthorAsync(id, model); if (author == null) { return(NotFound()); } return(Ok(author)); }
public bool Validate(AuthorCreation creation) { return (this.validator == null ? true : this.validator(creation, this)); }
public void Registered(AuthorCreation creation) { this._creation = creation; this._peiceID = this._peiceID ?? string.Empty; this.OnRegistered(); }
public bool Validate(AuthorCreation creation) { return((this.validator == null) || this.validator(creation, this)); }