renamed Table to Entity
This commit is contained in:
parent
971f4934d5
commit
104a5c9544
|
|
@ -71,7 +71,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Controllers
|
|||
|
||||
{
|
||||
|
||||
AnnouncementTable objOfAnnouncementDomain = new AnnouncementTable();
|
||||
AnnouncementEntity objOfAnnouncementDomain = new AnnouncementEntity();
|
||||
|
||||
objOfAnnouncementDomain.Name = model.Name;
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Controllers
|
|||
}
|
||||
|
||||
[HttpPost]
|
||||
public IActionResult Edit(AnnouncementTable model)
|
||||
public IActionResult Edit(AnnouncementEntity model)
|
||||
|
||||
{
|
||||
|
||||
|
|
@ -134,7 +134,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Controllers
|
|||
|
||||
var singleAnnouncement = await _announcementService.GetAnnouncementByIdAsync(Id);
|
||||
|
||||
var model = new AnnouncementTable();
|
||||
var model = new AnnouncementEntity();
|
||||
|
||||
model.Id = singleAnnouncement.Id;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains
|
||||
{
|
||||
|
||||
public class AnnouncementTable : BaseEntity
|
||||
public class AnnouncementEntity : BaseEntity
|
||||
|
||||
{
|
||||
|
||||
|
|
@ -3,10 +3,8 @@
|
|||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains
|
||||
{
|
||||
|
||||
public class BidTable : BaseEntity
|
||||
|
||||
public class BidEntity : BaseEntity
|
||||
{
|
||||
|
||||
public int CustomerId { get; set; }
|
||||
|
||||
public int ProductId { get; set; }
|
||||
|
|
@ -7,7 +7,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Mapping;
|
|||
/// <summary>
|
||||
/// Represents a pickup point entity builder
|
||||
/// </summary>
|
||||
public class AnnouncementBuilder : NopEntityBuilder<AnnouncementTable>
|
||||
public class AnnouncementBuilder : NopEntityBuilder<AnnouncementEntity>
|
||||
{
|
||||
#region Methods
|
||||
|
||||
|
|
@ -17,17 +17,16 @@ public class AnnouncementBuilder : NopEntityBuilder<AnnouncementTable>
|
|||
/// <param name="table">Create table expression builder</param>
|
||||
public override void MapEntity(CreateTableExpressionBuilder table)
|
||||
{
|
||||
table
|
||||
.WithColumn(nameof(AnnouncementTable.Id))
|
||||
table.WithColumn(nameof(AnnouncementEntity.Id))
|
||||
.AsInt16()
|
||||
.NotNullable()
|
||||
.WithColumn(nameof(AnnouncementTable.Name))
|
||||
.WithColumn(nameof(AnnouncementEntity.Name))
|
||||
.AsString(250)
|
||||
.NotNullable()
|
||||
.WithColumn(nameof(AnnouncementTable.IsActive))
|
||||
.WithColumn(nameof(AnnouncementEntity.IsActive))
|
||||
.AsBoolean()
|
||||
.NotNullable().WithDefault(0)
|
||||
.WithColumn(nameof(AnnouncementTable.Body))
|
||||
.WithColumn(nameof(AnnouncementEntity.Body))
|
||||
.AsString(500)
|
||||
.NotNullable();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Nop.Plugin.Misc.AuctionPlugin.Domains;
|
|||
|
||||
namespace Nop.Plugin.Misc.AuctionPlugin.Mapping.Builders
|
||||
{
|
||||
public class PluginBuilder : NopEntityBuilder<BidTable>
|
||||
public class PluginBuilder : NopEntityBuilder<BidEntity>
|
||||
{
|
||||
#region Methods
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Migrations
|
|||
/// </summary>
|
||||
public override void Up()
|
||||
{
|
||||
Create.TableFor<BidTable>();
|
||||
Create.TableFor<AnnouncementTable>();
|
||||
Create.TableFor<BidEntity>();
|
||||
Create.TableFor<AnnouncementEntity>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -14,13 +14,13 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
|||
{
|
||||
#region Field
|
||||
|
||||
private readonly IRepository<AnnouncementTable> _announcementRepository;
|
||||
private readonly IRepository<AnnouncementEntity> _announcementRepository;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Ctr
|
||||
|
||||
public AnnouncementService(IRepository<AnnouncementTable> announcementRepository)
|
||||
public AnnouncementService(IRepository<AnnouncementEntity> announcementRepository)
|
||||
{
|
||||
|
||||
_announcementRepository = announcementRepository;
|
||||
|
|
@ -31,7 +31,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
|||
|
||||
#region Methods
|
||||
|
||||
public async Task DeleteAsync(AnnouncementTable announcement)
|
||||
public async Task DeleteAsync(AnnouncementEntity announcement)
|
||||
{
|
||||
|
||||
await _announcementRepository.DeleteAsync(announcement);
|
||||
|
|
@ -40,7 +40,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
|||
|
||||
|
||||
|
||||
public async Task<bool> UpdateAsync(AnnouncementTable announcement)
|
||||
public async Task<bool> UpdateAsync(AnnouncementEntity announcement)
|
||||
|
||||
{
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
|||
}
|
||||
|
||||
|
||||
public async Task InsertAsync(AnnouncementTable announcement)
|
||||
public async Task InsertAsync(AnnouncementEntity announcement)
|
||||
|
||||
{
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
|||
}
|
||||
|
||||
|
||||
public async Task<IPagedList<AnnouncementTable>> GetAnnouncementsAsync(int pageIndex = 0, int pageSize = int.MaxValue)
|
||||
public async Task<IPagedList<AnnouncementEntity>> GetAnnouncementsAsync(int pageIndex = 0, int pageSize = int.MaxValue)
|
||||
|
||||
{
|
||||
|
||||
|
|
@ -76,13 +76,13 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
|||
|
||||
var query2 = query.OrderBy(b => b.IsActive).ToList();
|
||||
|
||||
var liveAnnouncementDomain = new PagedList<AnnouncementTable>(query2, pageIndex, pageSize);
|
||||
var liveAnnouncementDomain = new PagedList<AnnouncementEntity>(query2, pageIndex, pageSize);
|
||||
|
||||
return liveAnnouncementDomain;
|
||||
|
||||
}
|
||||
|
||||
public async Task<AnnouncementTable> GetAnnouncementDesignFirstAsync()
|
||||
public async Task<AnnouncementEntity> GetAnnouncementDesignFirstAsync()
|
||||
|
||||
{
|
||||
var result = await _announcementRepository.GetAllAsync(query =>
|
||||
|
|
@ -105,7 +105,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
|||
|
||||
}
|
||||
|
||||
public async Task<AnnouncementTable> GetAnnouncementByIdAsync(int Id)
|
||||
public async Task<AnnouncementEntity> GetAnnouncementByIdAsync(int Id)
|
||||
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class BidService : IBidService
|
|||
|
||||
#region Fields
|
||||
|
||||
protected readonly IRepository<BidTable> _customerBidRepository;
|
||||
protected readonly IRepository<BidEntity> _customerBidRepository;
|
||||
protected readonly IShortTermCacheManager _shortTermCacheManager;
|
||||
protected readonly IStaticCacheManager _staticCacheManager;
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ public class BidService : IBidService
|
|||
/// <param name="customerBidRepository">Store pickup point repository</param>
|
||||
/// <param name="shortTermCacheManager">Short term cache manager</param>
|
||||
/// <param name="staticCacheManager">Cache manager</param>
|
||||
public BidService(IRepository<BidTable> customerBidRepository,
|
||||
public BidService(IRepository<BidEntity> customerBidRepository,
|
||||
IShortTermCacheManager shortTermCacheManager,
|
||||
IStaticCacheManager staticCacheManager)
|
||||
{
|
||||
|
|
@ -62,9 +62,9 @@ public class BidService : IBidService
|
|||
/// A task that represents the asynchronous operation
|
||||
/// The task result contains the bids
|
||||
/// </returns>
|
||||
public virtual async Task<IPagedList<BidTable>> GetAllBidsAsync(int customerId = 0, int pageIndex = 0, int pageSize = int.MaxValue)
|
||||
public virtual async Task<IPagedList<BidEntity>> GetAllBidsAsync(int customerId = 0, int pageIndex = 0, int pageSize = int.MaxValue)
|
||||
{
|
||||
var rez = new List<BidTable>();
|
||||
var rez = new List<BidEntity>();
|
||||
//var rez = await _shortTermCacheManager.GetAsync(async () => await _customerBidRepository.GetAllAsync(query =>
|
||||
//{
|
||||
// if (customerId > 0)
|
||||
|
|
@ -74,21 +74,21 @@ public class BidService : IBidService
|
|||
// return query;
|
||||
//}), _pickupPointAllKey, customerId);
|
||||
|
||||
return new PagedList<BidTable>(rez, pageIndex, pageSize);
|
||||
return new PagedList<BidEntity>(rez, pageIndex, pageSize);
|
||||
}
|
||||
|
||||
public virtual async Task<BidTable> GetBidByIdAsync(int bidId)
|
||||
public virtual async Task<BidEntity> GetBidByIdAsync(int bidId)
|
||||
{
|
||||
return await _customerBidRepository.GetByIdAsync(bidId);
|
||||
}
|
||||
|
||||
public virtual async Task InsertBidAsync(BidTable bid)
|
||||
public virtual async Task InsertBidAsync(BidEntity bid)
|
||||
{
|
||||
await _customerBidRepository.InsertAsync(bid, false);
|
||||
await _staticCacheManager.RemoveByPrefixAsync(AUCTION_PATTERN_KEY);
|
||||
}
|
||||
|
||||
public virtual async Task UpdateBidAsync(BidTable bid)
|
||||
public virtual async Task UpdateBidAsync(BidEntity bid)
|
||||
{
|
||||
await _customerBidRepository.UpdateAsync(bid, false);
|
||||
await _staticCacheManager.RemoveByPrefixAsync(AUCTION_PATTERN_KEY);
|
||||
|
|
@ -99,7 +99,7 @@ public class BidService : IBidService
|
|||
/// </summary>
|
||||
/// <param name="pickupPoint">Pickup point</param>
|
||||
/// <returns>A task that represents the asynchronous operation</returns>
|
||||
public virtual async Task DeleteBidAsync(BidTable pickupPoint)
|
||||
public virtual async Task DeleteBidAsync(BidEntity pickupPoint)
|
||||
{
|
||||
await _customerBidRepository.DeleteAsync(pickupPoint, false);
|
||||
await _staticCacheManager.RemoveByPrefixAsync(AUCTION_PATTERN_KEY);
|
||||
|
|
|
|||
|
|
@ -13,17 +13,17 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
|||
|
||||
{
|
||||
|
||||
public Task DeleteAsync(AnnouncementTable announcement);
|
||||
public Task DeleteAsync(AnnouncementEntity announcement);
|
||||
|
||||
public Task InsertAsync(AnnouncementTable announcement);
|
||||
public Task InsertAsync(AnnouncementEntity announcement);
|
||||
|
||||
public Task<bool> UpdateAsync(AnnouncementTable announcement);
|
||||
public Task<bool> UpdateAsync(AnnouncementEntity announcement);
|
||||
|
||||
public Task<IPagedList<AnnouncementTable>> GetAnnouncementsAsync(int pageIndex = 0, int pageSize = int.MaxValue);
|
||||
public Task<IPagedList<AnnouncementEntity>> GetAnnouncementsAsync(int pageIndex = 0, int pageSize = int.MaxValue);
|
||||
|
||||
public Task<AnnouncementTable> GetAnnouncementDesignFirstAsync();
|
||||
public Task<AnnouncementEntity> GetAnnouncementDesignFirstAsync();
|
||||
|
||||
public Task<AnnouncementTable> GetAnnouncementByIdAsync(int Id);
|
||||
public Task<AnnouncementEntity> GetAnnouncementByIdAsync(int Id);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public interface IBidService
|
|||
/// A task that represents the asynchronous operation
|
||||
/// The task result contains the bids
|
||||
/// </returns>
|
||||
Task<IPagedList<BidTable>> GetAllBidsAsync(int customerId = 0, int pageIndex = 0, int pageSize = int.MaxValue);
|
||||
Task<IPagedList<BidEntity>> GetAllBidsAsync(int customerId = 0, int pageIndex = 0, int pageSize = int.MaxValue);
|
||||
|
||||
|
||||
Task<BidTable> GetBidByIdAsync(int bidId);
|
||||
Task<BidEntity> GetBidByIdAsync(int bidId);
|
||||
|
||||
|
||||
Task InsertBidAsync(BidTable bidTable);
|
||||
Task InsertBidAsync(BidEntity bidEntity);
|
||||
|
||||
|
||||
Task UpdateBidAsync(BidTable bid);
|
||||
Task UpdateBidAsync(BidEntity bid);
|
||||
|
||||
|
||||
Task DeleteBidAsync(BidTable pickupPoint);
|
||||
Task DeleteBidAsync(BidEntity pickupPoint);
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@ using System.Reflection;
|
|||
[assembly: System.Reflection.AssemblyCompanyAttribute("Nop.Plugin.Misc.AuctionPlugin")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+34184c6a9f0a84d2194da6cfd8fdf416357056ef")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+971f4934d58e82b225c4ae427f13f08251e27410")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Nop.Plugin.Misc.AuctionPlugin")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Nop.Plugin.Misc.AuctionPlugin")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
d64ed4ed36a99c43d3d81f6442418fbb91a5a610f4437c0f2490b978c47ca144
|
||||
78c79a6279758bf6029272b201ba6b7198a9b5ffd66137652c24adcb76d3bd07
|
||||
|
|
|
|||
Loading…
Reference in New Issue