using APT.BaseData.Domain.Entities;
using APT.BaseData.Domain.IServices;
using APT.Infrastructure.Core;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using APT.Utility;namespace APT.PF.WebApiControllers.Api.PF
{
	[Route("api/PF/PFPicFilter")]
    [APT.Infrastructure.Api.RootOrg]
    public class PicFilter : AuthorizeApiController<T_PF_PIC_FILTER>
	{

        /// <summary>
        /// 更新信息
        /// </summary>
        /// <param name="label"></param>
        /// <returns></returns>
        [HttpPost, Route("FullUpdate")]
        public JsonActionResult<bool> FullUpdate([FromBody] T_PF_PIC_FILTER entity)
        {
            return SafeExecute(() =>
            {
                var detail = entity.Nav_PicFilterDetail;
                entity.Nav_PicFilterDetail = null;
                this.UnifiedCommit(() =>
                {
                    this.UpdateEntityNoCommit(entity);
                    if(detail!=null)
                        this.BantchSaveEntityNoCommit(detail);
                });
                return true;
            });
        }


    }
}
