Himall.Service/MarketService.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using Himall.Core;
using Himall.Entity;
using Himall.IServices;
using Himall.IServices.QueryModel;
using Himall.Model;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;

namespace Himall.Service
{
	public class MarketService : ServiceBase, IMarketService, IService, IDisposable
	{
		public MarketService()
		{
		}

		public void AddOrUpdateServiceSetting(MarketSettingInfo info)
		{
			MarketSettingInfo price = context.MarketSettingInfo.FirstOrDefault((MarketSettingInfo a) => (int)a.TypeId == (int)info.TypeId);
			if (price != null)
			{
				price.Price = info.Price;
			}
			else
			{
                context.MarketSettingInfo.Add(info);
			}
            context.SaveChanges();
		}

		public PageModel<MarketServiceRecordInfo> GetBoughtShopList(MarketBoughtQuery query)
		{
			IQueryable<MarketServiceRecordInfo> typeId = context.MarketServiceRecordInfo.AsQueryable<MarketServiceRecordInfo>();
			if (query.MarketType.HasValue)
			{
				typeId = 
					from d in typeId
					where (int)d.ActiveMarketServiceInfo.TypeId == (int)query.MarketType.Value
					select d;
			}
			if (!string.IsNullOrWhiteSpace(query.ShopName))
			{
				typeId = 
					from d in typeId
					where d.ActiveMarketServiceInfo.ShopName.Contains(query.ShopName)
					select d;
			}
			int num = 0;
			typeId = typeId.GetPage(out num, query.PageNo, query.PageSize, null);
			return new PageModel<MarketServiceRecordInfo>()
			{
				Models = typeId,
				Total = num
			};
		}

后面还有 60 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。