예제 #1
0
        /// <summary>
        /// Creates a new <c>Asset</c> for use in the system.
        /// </summary>
        /// <param name="name">Name being assigned to the <c>Asset</c>.</param>
        /// <param name="description">Content being assigned to the <c>Asset</c></param>
        /// <returns>The newly created <c>Asset</c> entity.</returns>
        public static Asset NewAsset(string name)
        {
            //Name must not be null.
            Validate.NotNull(name);

            string id = Guid.NewGuid().ToString();

            Asset asset = new Asset(id, name);

            //Asset defaults to private when created.
            asset.SetToPrivate();

            //Asset defaults to editable state when created.
            asset.SetAsEditable();

            return asset;
        }