コード例 #1
0
ファイル: Book.cs プロジェクト: Cogitandi/Library
        /// <summary>
        /// Return book by the given user
        /// </summary>
        /// <param name="user">User which borrowed book</param>
        public void Return(IdentityUser <Guid> user)
        {
            IsBorrowed = false;
            var action = new BookAction()
            {
                Name = BookAction.Action_Return,
                Date = DateTime.Now,
                User = user,
            };

            Actions.Add(action);
        }
コード例 #2
0
ファイル: Book.cs プロジェクト: Cogitandi/Library
        /// <summary>
        /// Borrow book by the given user
        /// </summary>
        /// <param name="user">User which borrow book</param>
        public void Borrow(IdentityUser <Guid> user)
        {
            IsBorrowed = true;
            var action = new BookAction()
            {
                Name = BookAction.Action_Borrow,
                Date = DateTime.Now,
                User = user,
            };

            Actions.Add(action);
        }