Added Interfaces project which holds everything required for the IRepository Interface

This commit is contained in:
Chris.Watts90@outlook.com 2017-01-31 17:24:16 +00:00
parent 1fe6e94d0f
commit 1ad53fbe76
11 changed files with 205 additions and 0 deletions

View File

@ -0,0 +1,17 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Interfaces
{
public interface IRepository
{
UserList GetUsers();
User GetUser(int id);
TimeLogList GetTimeLogs(int userId);
TimeLogList GetTimeLogs(int userId, int calendarWeek);
IdentifierList GetUnassignedList();
OperationResponse UpdateUser(User user);
OperationResponse LogEventTime(Identifier identifier);
}
}

View File

@ -0,0 +1,9 @@
namespace Interfaces
{
public class Identifier
{
public int Id { get; set; }
public string UniqueId { get; set; }
public bool IsAssociatedToUser { get; set; }
}
}

View File

@ -0,0 +1,13 @@
using System.Collections.Generic;
namespace Interfaces
{
public class IdentifierList
{
public IdentifierList()
{
data = new List<Identifier>();
}
public List<Identifier> data { get; set; }
}
}

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B7347B72-E208-423A-9D99-723B558EA3D7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Interfaces</RootNamespace>
<AssemblyName>Interfaces</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="IRepository.cs" />
<Compile Include="Identifier.cs" />
<Compile Include="IdentifierList.cs" />
<Compile Include="OperationResponse.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TimeLog.cs" />
<Compile Include="TimeLogList.cs" />
<Compile Include="User.cs" />
<Compile Include="UserList.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,12 @@
namespace Interfaces
{
public enum OperationResponse
{
NONE = 0,
SUCCESS = 1,
CREATED = 2,
UPDATED = 3,
DELETED = 4,
FAILED = 5
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Interfaces")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Interfaces")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b7347b72-e208-423a-9d99-723b558ea3d7")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,11 @@
using System;
namespace Interfaces
{
public class TimeLog
{
public DateTimeOffset EventTime { get; set; }
public int UserId { get; set; }
public bool Direction { get; set; }
}
}

View File

@ -0,0 +1,10 @@
using System.Collections.Generic;
namespace Interfaces
{
public class TimeLogList
{
public int CalendarWeek { get; set; }
public List<TimeLog> TimeLogs { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System.Collections.Generic;
namespace Interfaces
{
public class User
{
public User()
{
AssociatedIdentifiers = new List<Identifier>();
}
public int UserId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public int HoursPerWeek { get; set; }
public int AssociatedIdentifierCount { get; set; }
public List<Identifier> AssociatedIdentifiers { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using System.Collections.Generic;
namespace Interfaces
{
public class UserList
{
public int UserCount { get; set; }
public List<User> Users { get; set; }
public int PageSize { get; set; }
public int PageNumber { get; set; }
}
}

View File

@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsDataCenter", "Window
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsDataServiceHost", "WindowsDataServiceHost\WindowsDataServiceHost.csproj", "{5A4E2CF2-FA51-413E-82C7-14A19A50766D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Interfaces", "Interfaces\Interfaces.csproj", "{B7347B72-E208-423A-9D99-723B558EA3D7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -21,6 +23,10 @@ Global
{5A4E2CF2-FA51-413E-82C7-14A19A50766D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A4E2CF2-FA51-413E-82C7-14A19A50766D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A4E2CF2-FA51-413E-82C7-14A19A50766D}.Release|Any CPU.Build.0 = Release|Any CPU
{B7347B72-E208-423A-9D99-723B558EA3D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7347B72-E208-423A-9D99-723B558EA3D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7347B72-E208-423A-9D99-723B558EA3D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7347B72-E208-423A-9D99-723B558EA3D7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE