Skip to content

Commit

Permalink
Merge pull request #185 from raffacabofrio/master
Browse files Browse the repository at this point in the history
Adicionar facilitador no endpoint "book paged list".
  • Loading branch information
wantero committed Dec 29, 2018
2 parents 5f492ad + a764198 commit 99b3a4f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ protected DomainToViewModelMappingProfile(string profileName) : base(profileName
#region [ Book ]
CreateMap<Book, BooksVM>()
.ForMember(dest => dest.Donor, opt => opt.MapFrom(src => src.User.Name))
.ForMember(dest => dest.Facilitator, opt => opt.MapFrom(src => src.UserFacilitator.Name))
.ForMember(dest => dest.Donated, opt => opt.MapFrom(src => src.Donated()))
.ForMember(dest => dest.PhoneDonor, opt => opt.MapFrom(src => src.User.Phone))
.ForMember(dest => dest.DaysInShowcase, opt => opt.MapFrom(src => src.DaysInShowcase()))
Expand Down
2 changes: 1 addition & 1 deletion ShareBook/ShareBook.Api/Controllers/BookController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected void SetDefault(Expression<Func<Book, object>> defaultOrder)
[AuthorizationFilter(Permissions.Permission.DonateBook)]
public PagedList<BooksVM> Paged(int page, int items)
{
var books = _service.Get(x => x.Title, page, items, new IncludeList<Book>(x => x.User, x => x.BookUsers));
var books = _service.Get(x => x.Title, page, items, new IncludeList<Book>(x => x.User, x => x.BookUsers, x => x.UserFacilitator));
var responseVM = Mapper.Map<List<BooksVM>>(books.Items);
return new PagedList<BooksVM>()
{
Expand Down
1 change: 1 addition & 0 deletions ShareBook/ShareBook.Api/ViewModels/BooksVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class BooksVM
public string Author { get; set; }
public bool Donated { get; set; }
public string Donor { get; set; }
public string Facilitator { get; set; }
public bool Approved { get; set; }
public string PhoneDonor { get; set; }
public int DaysInShowcase { get; set; }
Expand Down
16 changes: 8 additions & 8 deletions ShareBook/ShareBook.Repository/ShareBook.Infra.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JsonDiffPatch.Net" Version="2.1.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.3"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.3"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.3"/>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2"/>
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.2.4"/>
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.2.4"/>
<PackageReference Include="JsonDiffPatch.Net" Version="2.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.2.4" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.2.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ShareBook.Domain\ShareBook.Domain.csproj"/>
<ProjectReference Include="..\ShareBook.Domain\ShareBook.Domain.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.IdentityModel.Tokens">
Expand Down

0 comments on commit 99b3a4f

Please sign in to comment.