Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis task #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions Tweets/Tweets/Repositories/UserRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,22 @@ public UserRepository(RedisClient redisClient, IMapper<User, UserDocument> userD
public void Save(User user)
{
//TODO: Здесь нужно реализовать сохранение пользователя в Redis
var userDocument = userDocumentMapper.Map(user);
redisClient.Set(userDocument.Id, userDocument);
redisClient.Save();
}

public User Get(string userName)
{
//TODO: Здесь нужно доставать пользователя из Redis
return new User
{
Name = userName,
DisplayName = "Какой-то пользователь",
ImageUrl = new Uri("http://www.kagms.ru/upload/medialibrary/b3a/no-image-icon-md.jpg")
};
//return new User
// {
// Name = userName,
// DisplayName = "Какой-то пользователь",
// ImageUrl = new Uri("http://www.kagms.ru/upload/medialibrary/b3a/no-image-icon-md.jpg")
// };
var userDocument = redisClient.Get<UserDocument>(userName);
return userDocument == null ? null : userMapper.Map(userDocument);
}
}
}
2 changes: 1 addition & 1 deletion Tweets/Tweets/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.0.0" targetFramework="net45" />
<package id="mongocsharpdriver" version="1.8.3" targetFramework="net45" />
<package id="mongocsharpdriver" version="1.9.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="5.0.6" targetFramework="net45" />
<package id="ServiceStack.Common" version="4.0.17" targetFramework="net45" />
<package id="ServiceStack.Interfaces" version="4.0.17" targetFramework="net45" />
Expand Down
Binary file not shown.
16 changes: 16 additions & 0 deletions Tweets/packages/AutoFixture.3.16.6/AutoFixture.3.16.6.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>AutoFixture</id>
<version>3.16.6</version>
<title>AutoFixture</title>
<authors>Mark Seemann</authors>
<owners>Mark Seemann</owners>
<licenseUrl>https://github.com/AutoFixture/AutoFixture/blob/master/LICENCE.txt</licenseUrl>
<projectUrl>https://github.com/AutoFixture/AutoFixture</projectUrl>
<iconUrl>http://i3.codeplex.com/Download?ProjectName=autofixture&amp;DownloadId=278049</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>AutoFixture makes it easier for developers to do Test-Driven Development by automating non-relevant Test Fixture Setup, allowing the Test Developer to focus on the essentials of each test case.</description>
<language>en-US</language>
</metadata>
</package>
10,368 changes: 10,368 additions & 0 deletions Tweets/packages/AutoFixture.3.16.6/lib/net40/Ploeh.AutoFixture.XML

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>AutoFixture.AutoRhinoMocks</id>
<version>3.16.6</version>
<title>AutoFixture with Auto Mocking using Rhino Mocks</title>
<authors>Mark Seemann</authors>
<owners>Mark Seemann</owners>
<licenseUrl>https://github.com/AutoFixture/AutoFixture/blob/master/LICENCE.txt</licenseUrl>
<projectUrl>https://github.com/AutoFixture/AutoFixture</projectUrl>
<iconUrl>http://i3.codeplex.com/Download?ProjectName=autofixture&amp;DownloadId=278049</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This extension turns AutoFixture into an Auto-Mocking Container. The mock instances are created by Rhino Mocks. To use it, add the AutoRhinoMockCustomization to your Fixture instance. Read more at http://blog.ploeh.dk/2010/11/13/RhinoMocksbasedAutomockingWithAutoFixture.aspx</description>
<summary>Turns AutoFixture into an Auto-Mocking Container based on Rhino Mocks.</summary>
<language>en-US</language>
<dependencies>
<dependency id="autofixture" version="3.16.6" />
<dependency id="RhinoMocks" version="3.6" />
</dependencies>
</metadata>
</package>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
param($installPath, $toolsPath, $package, $project)

# Automatically adds assembly binding redirects to the target project's configuration file
# in order to map the package's dependencies to the assemblies referenced by the project.
Add-BindingRedirect -ProjectName $project.Name
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Microsoft.AspNet.Mvc</id>
<version>5.0.0</version>
<title>Microsoft ASP.NET MVC</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_ENU.htm</licenseUrl>
<projectUrl>http://www.asp.net/mvc</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>This package contains the runtime assemblies for ASP.NET MVC. ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that enables a clean separation of concerns and that gives you full control over markup.</description>
<summary>This package contains the runtime assemblies for ASP.NET MVC.</summary>
<releaseNotes>Please go here to view the release notes: http://go.microsoft.com/fwlink/?LinkID=320753&amp;clcid=0x409</releaseNotes>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<language>en-US</language>
<tags>Microsoft AspNet Mvc AspNetMvc</tags>
<dependencies>
<dependency id="Microsoft.AspNet.WebPages" version="3.0.0" />
<dependency id="Microsoft.AspNet.Razor" version="3.0.0" />
</dependencies>
</metadata>
</package>
Binary file not shown.
Loading