Beispiel #1
0
        /// <summary>
        ///     创建发动机型号
        /// </summary>
        /// <param name="name">名称</param>
        /// <param name="manufacturerId">制造商</param>
        /// <returns>备发计划</returns>
        public static EngineType CreateEngineType(string name,Guid manufacturerId)
        {
            var engineType = new EngineType
            {
                ManufacturerId=manufacturerId,
                Name=name,
            };

            engineType.GenerateNewIdentity();
            return engineType;
        }
Beispiel #2
0
        /// <summary>
        ///     设置发动机型号
        /// </summary>
        /// <param name="engineType">发动机型号</param>
        public void SetEngineType(EngineType engineType)
        {
            if (engineType == null || engineType.IsTransient())
            {
                throw new ArgumentException("发动机型号参数为空!");
            }

            EngineType = engineType;
            EngineTypeId = engineType.Id;
        }