Fixes the membership update.

This commit is contained in:
Paul Schneider 2015-08-01 22:34:59 +02:00
commit 294c54099c
35 changed files with 2683 additions and 11 deletions

View file

@ -0,0 +1,19 @@
using System;
using Yavsc.Model.Blogs;
using Yavsc.Model.RolesAndMembers;
using System.Web;
using System.Web.Security;
using Yavsc.Model.Circles;
using System.Web.Mvc;
using System.IO;
using System.Linq;
namespace Yavsc.Model.Blogs
{
public class PostNotFoundException : Exception
{
}
}

View file

@ -0,0 +1,53 @@
//
// UUBlogEntryCollection.cs
//
// Author:
// Paul Schneider <paul@pschneider.fr>
//
// Copyright (c) 2015 GNU GPL
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
namespace Yavsc.Model.Blogs
{
/// <summary>
/// Unique User blog entry collection.
/// </summary>
public class UUBlogEntryCollection: BlogEntryCollection {
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.Blogs.UUBlogEntryCollection"/> class.
/// </summary>
/// <param name="username">Username.</param>
/// <param name="items">Items.</param>
public UUBlogEntryCollection(string username,
BlogEntryCollection items = null) {
if (items != null) {
if (!items.ConcernsAUniqueUser)
throw new InvalidOperationException ();
this.AddRange (items);
}
_username = username;
}
private string _username;
/// <summary>
/// Gets the name of the user.
/// </summary>
/// <value>The name of the user.</value>
public string UserName { get { return _username; } }
}
}

View file

@ -0,0 +1,64 @@
//
// UUTBlogEntryCollection.cs
//
// Author:
// Paul Schneider <paul@pschneider.fr>
//
// Copyright (c) 2015 GNU GPL
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Net.Mime;
using System.Runtime.Serialization.Formatters.Binary;
using System.Web;
using System.Web.Configuration;
using System.Web.Profile;
using System.Web.Security;
using Npgsql.Web.Blog;
using Yavsc;
using Yavsc.Model;
using Yavsc.Model.Blogs;
using Yavsc.ApiControllers;
using Yavsc.Model.RolesAndMembers;
using System.Net;
using System.Web.Mvc;
using Yavsc.Model.Circles;
namespace Yavsc.Controllers
{
public class UUTBlogEntryCollection : BlogEntryCollection {
UUTBlogEntryCollection(string username, string title,
public BlogEntryCollection items = null) {
if (items != null) {
if (!items.ConcernsAUniqueTitle && items.ConcernsAUniqueTitle)
throw new InvalidOperationException ();
this.AddRange (items);
}
_title = title;
_username = username;
}
private string _title;
private string _username;
public string UserName { get { return _username; } }
public string Title { get { return _title; } }
}
}