This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<configuration> | |
<system.serviceModel> | |
<services> | |
<service name="WcfJsonRestService.Service1" behaviorConfiguration="MyServiceBehavior"> | |
<endpoint address="" binding="webHttpBinding" contract="WcfJsonRestService.IService1"/> | |
<host> | |
<baseAddresses> | |
<add baseAddress="http://localhost:8732/service1" /> | |
</baseAddresses> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<configuration> | |
<system.serviceModel> | |
<services> | |
<service name="WcfJsonRestService.Service1" behaviorConfiguration="MyServiceBehavior"> | |
<endpoint address="" binding="webHttpBinding" contract="WcfJsonRestService.IService1"/> | |
<host> | |
<baseAddresses> | |
<add baseAddress="http://localhost:8732/service1" /> | |
</baseAddresses> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<configuration> | |
<system.serviceModel> | |
<services> | |
<service name="WcfJsonRestService.Service1" behaviorConfiguration="MyServiceBehavior"> | |
<endpoint address="" binding="webHttpBinding" contract="WcfJsonRestService.IService1"/> | |
<host> | |
<baseAddresses> | |
<add baseAddress="http://localhost:8732/service1" /> | |
</baseAddresses> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AccountRepository : DataRepositoryBase<Account>, IAccountRepository | |
{ | |
protected override Account AddEntity(CarRentalContext entityContext, Account entity) | |
{ | |
return entityContext.AccountSet.Add(entity); | |
} | |
protected override Account UpdateEntity(CarRentalContext entityContext, Account entity) | |
{ | |
return (from e in entityContext.AccountSet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class DataRepositoryBase<T> : DataRepositoryBase<T, CarRentalContext> | |
where T : class, IIdentifiableEntity, new() | |
{ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class DataRepositoryBase<T, U> : IDataRepository<T> | |
where T : class, IIdentifiableEntity, new() | |
where U : DbContext, new() | |
{ | |
protected abstract T AddEntity(U entityContext, T entity); | |
protected abstract T UpdateEntity(U entityContext, T entity); | |
protected abstract IEnumerable<T> GetEntities(U entityContext); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IDataRepository | |
{ | |
} | |
public interface IDataRepository<T> : IDataRepository | |
where T : class, IIdentifiableEntity, new() | |
{ | |
T Add(T entity); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IIdentifiableEntity | |
{ | |
int EntityId { get; set; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel.Composition; | |
using CarRental.Business.Bootstrapper; | |
using CarRental.Business.Entities; | |
using CarRental.Data.Contracts; | |
using Core.Common.Contracts; | |
using Core.Common.Core; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using Moq; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
* { | |
-webkit-box-sizing: border-box; |
OlderNewer