using System; using ProtoBuf; using Fantasy; using System.Linq; using System.Reflection; using System.Collections.Generic; using System.Collections.Concurrent; using NBC; using Fantasy.Serialize; namespace NBF { [ProtoContract] public sealed partial class UnitConfig : ASerialize, IConfigTable { [ProtoMember(1)] public uint Id { get; set; } // Id [ProtoMember(2)] public string Name { get; set; } // 名称 [ProtoMember(3)] public string Model { get; set; } // 数据库类型 [ProtoIgnore] public uint Key => Id; #region Static private static ConfigContext Context => ConfigTableHelper.Table(); public static UnitConfig Get(uint key) { return Context.Get(key); } public static UnitConfig Get(Predicate match) { return Context.Get(match); } public static UnitConfig Fist() { return Context.Fist(); } public static UnitConfig Last() { return Context.Last(); } public static UnitConfig Fist(Predicate match) { return Context.Fist(match); } public static UnitConfig Last(Predicate match) { return Context.Last(match); } public static int Count() { return Context.Count(); } public static int Count(Func predicate) { return Context.Count(predicate); } public static List GetList() { return Context.GetList(); } public static List GetList(Predicate match) { return Context.GetList(match); } public static void ParseJson(Newtonsoft.Json.Linq.JArray arr) { ConfigTableHelper.ParseLine(arr); } #endregion } }