Skip to content

Commit

Permalink
Some small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tidyui committed Mar 3, 2019
1 parent cb27e64 commit fb51897
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion core/Piranha.Manager/Manager/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void CreateAlias(IApi api, Guid siteId, string alias, string redir
api.Aliases.Save(aliasModel);
} else {
// Let's create a new alias
api.Aliases.Save(new Models.Alias() {
api.Aliases.Save(new Models.Alias {
SiteId = siteId,
AliasUrl = alias,
RedirectUrl = redirect,
Expand Down
19 changes: 3 additions & 16 deletions core/Piranha/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ public sealed class App
/// </summary>
private Cache.CacheLevel _cacheLevel = Cache.CacheLevel.Full;

/// <summary>
/// The application object mapper.
/// </summary>
//private IMapper _mapper;

/// <summary>
/// The application markdown converter.
/// </summary>
Expand All @@ -98,20 +93,17 @@ public sealed class App
/// <summary>
/// The currently available page types.
/// </summary>

private ContentTypeList<Models.PageType> _pageTypes;
private readonly ContentTypeList<Models.PageType> _pageTypes;

/// <summary>
/// The currently available post types.
/// </summary>

private ContentTypeList<Models.PostType> _postTypes;
private readonly ContentTypeList<Models.PostType> _postTypes;

/// <summary>
/// The currently available post types.
/// </summary>

private ContentTypeList<Models.SiteType> _siteTypes;
private readonly ContentTypeList<Models.SiteType> _siteTypes;

/// <summary>
/// Gets the currently registered block types.
Expand All @@ -133,11 +125,6 @@ public sealed class App
/// </summary>
public static MediaManager MediaTypes => Instance._mediaTypes;

/// <summary>
/// Gets the application object mapper.
/// </summary>
//public static IMapper Mapper => Instance._mapper;

/// <summary>
/// Gets the markdown converter.
/// </summary>
Expand Down
11 changes: 8 additions & 3 deletions core/Piranha/Services/AliasService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public AliasService(IAliasRepository repo, SiteService siteService, ICache cache
/// <returns>The available models</returns>
public async Task<IEnumerable<Alias>> GetAllAsync(Guid? siteId = null)
{
var models = new List<Alias>();

if (!siteId.HasValue)
{
var site = await _siteService.GetDefaultAsync();
Expand All @@ -56,7 +54,12 @@ public async Task<IEnumerable<Alias>> GetAllAsync(Guid? siteId = null)
siteId = site.Id;
}
}
return await _repo.GetAll(siteId.Value);

if (siteId.HasValue)
{
return await _repo.GetAll(siteId.Value);
}
return null;
}

/// <summary>
Expand Down Expand Up @@ -122,7 +125,9 @@ public async Task<IEnumerable<Alias>> GetByRedirectUrlAsync(string url, Guid? si
{
var site = await _siteService.GetDefaultAsync();
if (site != null)
{
siteId = site.Id;
}
}
return await _repo.GetByRedirectUrl(url, siteId.Value);
}
Expand Down
2 changes: 2 additions & 0 deletions core/Piranha/Services/ContentFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ public object CreateDynamicRegion(ContentType type, string regionId)
var region = type.Regions.FirstOrDefault(r => r.Id == regionId);

if (region != null)
{
return CreateDynamicRegion(scope, region);
}
return null;
}
}
Expand Down
1 change: 0 additions & 1 deletion core/Piranha/Services/IContentFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public interface IContentFactory
/// <returns>The new region value</returns>
object CreateDynamicRegion(ContentType type, string regionId);


/// <summary>
/// Creates and initializes a new block of the specified type.
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion core/Piranha/Services/MediaService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ public async Task<MediaFolder> GetFolderByIdAsync(Guid id)
OnFolderLoad(model);
}
return model;

}

/// <summary>
Expand Down

0 comments on commit fb51897

Please sign in to comment.