Skip to content

Commit

Permalink
Merge pull request #81 from YodasMyDad/mvcforum-dev
Browse files Browse the repository at this point in the history
Merging in v1.9
  • Loading branch information
YodasMyDad committed Aug 8, 2016
2 parents 37e8318 + 77f9ec1 commit c69d2e2
Show file tree
Hide file tree
Showing 252 changed files with 50,342 additions and 7,971 deletions.
2 changes: 1 addition & 1 deletion MVCForum.Badges/Badge.Grouch/GrouchBadge.cs
Expand Up @@ -26,7 +26,7 @@ public bool Rule(MembershipUser user)
{
// Get all down votes
var downVotes = _voteService.GetAllVotesByUser(user.Id).Where(x => x.Amount < 1).ToList();
return downVotes.Count() >= 10;
return downVotes.Count >= 10;
}
}

Expand Down
3 changes: 1 addition & 2 deletions MVCForum.Core/Constants/AppConstants.cs
Expand Up @@ -15,10 +15,9 @@ public static class AppConstants
public const string MemberEmailConfirmationCookieName = "MVCForumEmailConfirmation";

// Cache names
public const string SettingsCacheName = "MainSettings";
//TODO - Move to cache keys
public const string LocalisationCacheName = "Localization-";
public static string LanguageStrings = string.Concat(LocalisationCacheName, "LangStrings-");
public const string MemberCacheName = "#member#-{0}";

// View Bag / Temp Data Constants
public const string MessageViewBagName = "Message";
Expand Down
133 changes: 133 additions & 0 deletions MVCForum.Core/Constants/CacheKeys.cs
@@ -0,0 +1,133 @@
namespace MVCForum.Domain.Constants
{
public static class CacheKeys
{
public const string Domain = "ThisDomain";

public static class Topic
{
public const string StartsWith = "Topic.";
}

public static class TopicTag
{
public const string StartsWith = "TopicTag.";
}

public static class Post
{
public const string StartsWith = "Post.";
}

public static class PrivateMessage
{
public const string StartsWith = "PrivateMessage.";
}

public static class PostEdit
{
public const string StartsWith = "PostEdit.";
}

public static class Category
{
public const string StartsWith = "Category.";
}

public static class Member
{
public const string StartsWith = "Member.";
}

public static class Role
{
public const string StartsWith = "Role.";
}

public static class Permission
{
public const string StartsWith = "Permission.";
}

public static class Activity
{
public const string StartsWith = "Activity.";
}

public static class Badge
{
public const string StartsWith = "Badge.";
}

public static class BannedEmail
{
public const string StartsWith = "BannedEmail.";
}

public static class Vote
{
public const string StartsWith = "Vote.";
}

public static class BannedWord
{
public const string StartsWith = "BannedWord.";
}

public static class CategoryNotification
{
public const string StartsWith = "CategoryNotification.";
}

public static class CategoryPermissionForRole
{
public const string StartsWith = "CategoryPermissionForRole.";
}

public static class Block
{
public const string StartsWith = "Block.";
}

public static class Favourite
{
public const string StartsWith = "Favourite.";
}

public static class PollAnswer
{
public const string StartsWith = "PollAnswer.";
}

public static class Poll
{
public const string StartsWith = "Poll.";
}

public static class PollVote
{
public const string StartsWith = "PollVote.";
}

public static class GlobalPermissionForRole
{
public const string StartsWith = "GlobalPermissionForRole.";
}

public static class Language
{
public const string StartsWith = "Language.";
}

public static class MembershipUserPoints
{
public const string StartsWith = "MembershipUserPoints.";
}

public static class Settings
{
public const string StartsWith = "Settings.";
public static string Main = string.Concat(StartsWith, "mainsettings");
}
}
}
5 changes: 5 additions & 0 deletions MVCForum.Core/Constants/SiteConstants.cs
Expand Up @@ -101,6 +101,11 @@ public string GetType(string key)
public int PrivateMessageListSize => Convert.ToInt32(GetConfig("PrivateMessageListSize"));
public int SimilarTopicsListSize => Convert.ToInt32(GetConfig("SimilarTopicsListSize"));

/// <summary>
/// Post Settings
/// </summary>
public bool IncludeFullPostInEmailNotifications => Convert.ToBoolean(GetConfig("IncludeFullPostInEmailNotifications"));

/// <summary>
/// Social Gravatar size
/// </summary>
Expand Down
7 changes: 2 additions & 5 deletions MVCForum.Core/DomainModel/Entities/Topic.cs
Expand Up @@ -30,11 +30,8 @@ public Topic()
public virtual IList<Favourite> Favourites { get; set; }
public virtual Poll Poll { get; set; }
public bool? Pending { get; set; }
public string NiceUrl
{
get { return UrlTypes.GenerateUrl(UrlType.Topic, Slug); }
//get { return Slug; }
}
public string NiceUrl => UrlTypes.GenerateUrl(UrlType.Topic, Slug);

public int VoteCount
{
get { return Posts.Select(x => x.VoteCount).Sum(); }
Expand Down
12 changes: 6 additions & 6 deletions MVCForum.Core/Interfaces/Services/ICacheService.cs
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using MVCForum.Domain.DomainModel.Enums;

namespace MVCForum.Domain.Interfaces.Services
namespace MVCForum.Domain.Interfaces.Services
{
using System;
using System.Collections.Generic;
using DomainModel.Enums;

public partial interface ICacheService
{
T Get<T>(string key);
Expand All @@ -14,13 +15,12 @@ public partial interface ICacheService
/// <param name="data">Object / Data to cache</param>
/// <param name="minutesToCache">How many minutes to cache them for</param>
void Set(string key, object data, CacheTimes minutesToCache);

bool IsSet(string key);
void Invalidate(string key);
void Clear();
void ClearStartsWith(string keyStartsWith);
void ClearStartsWith(List<string> keysStartsWith);
THelper CachePerRequest<THelper>(string cacheKey);
T CachePerRequest<T>(string cacheKey, Func<T> getCacheItem);
void SetPerRequest(string cacheKey, object objectToCache);
}
}
1 change: 1 addition & 0 deletions MVCForum.Core/MVCForum.Domain.csproj
Expand Up @@ -78,6 +78,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Constants\AppConstants.cs" />
<Compile Include="Constants\CacheKeys.cs" />
<Compile Include="Constants\SiteConstants.cs" />
<Compile Include="DomainModel\Activity\ActivityBase.cs" />
<Compile Include="DomainModel\Activity\BadgeActivity.cs" />
Expand Down
2 changes: 1 addition & 1 deletion MVCForum.IOC/App.config
Expand Up @@ -29,7 +29,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
Expand Down
4 changes: 2 additions & 2 deletions MVCForum.IOC/MVCForum.IOC.csproj
Expand Up @@ -72,8 +72,8 @@
<Private>True</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Quartz, Version=2.3.3.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
Expand Down
1 change: 1 addition & 0 deletions MVCForum.IOC/UnityHelper.cs
Expand Up @@ -49,6 +49,7 @@ private static IUnityContainer BuildUnityContainer(UnityContainer container)
container.BindInRequestScope<IMVCForumContext, MVCForumContext>();
container.BindInRequestScope<IUnitOfWorkManager, UnitOfWorkManager>();


// Quartz
container.AddNewExtension<QuartzUnityExtension>();

Expand Down
2 changes: 1 addition & 1 deletion MVCForum.IOC/packages.config
Expand Up @@ -10,7 +10,7 @@
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
<package id="Quartz" version="2.3.3" targetFramework="net45" />
<package id="Unity" version="4.0.1" targetFramework="net45" />
</packages>

0 comments on commit c69d2e2

Please sign in to comment.