This file contains 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 static Uri CreateUri(int port = 80) | |
{ | |
var host = Process.GetProcessesByName("fiddler").Any() ? "ipv4.fiddler" : "localhost"; | |
var portNumber = port == 80 ? string.Empty : ":" + port; | |
return new Uri("http://" + host + portNumber); | |
} |
This file contains 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.Web.Http; | |
using WebActivatorEx; | |
using SwaggerTest; | |
using Swashbuckle.Application; | |
[assembly: PreApplicationStartMethod(typeof(SwaggerConfig), "Register")] | |
namespace SwaggerTest | |
{ | |
public class SwaggerConfig |
This file contains 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
{ | |
swagger: "2.0", | |
info: { | |
version: "v1", | |
title: "SwaggerTest" | |
}, | |
host: "localhost:63171", | |
schemes: [ | |
"http" | |
], |
This file contains 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.ServiceModel.Description; | |
using System.ServiceModel.Dispatcher; | |
namespace APIServiceConsumer.Services | |
{ | |
public class CustomInspectorBehavior : IEndpointBehavior | |
{ | |
private readonly ClientMessageInspector clientMessageInspector = new ClientMessageInspector(); | |
public string LastRequestXml |
This file contains 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.IO; | |
using System.Net; | |
using System.Security.Policy; | |
using System.ServiceModel.Channels; | |
using System.ServiceModel.Dispatcher; | |
using System.Xml; | |
namespace APIServiceConsumer.Services | |
{ |
This file contains 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 APIConsumerServices.Services.CustomService; | |
using FluentAssertions; | |
using NUnit.Framework; | |
namespace APIConsumerServices.Services.Tests | |
{ | |
[TestFixture] | |
public class CallServiceTest | |
{ | |
// CustomClient is the wrapper around the WSDL generated proxy class |
This file contains 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
<script type="text/javascript"> | |
$(document).ready(function() { | |
// The event listener for the file upload | |
document.getElementById('txtFileUpload').addEventListener('change', upload, false); | |
// Method that checks that the browser supports the HTML5 File API | |
function browserSupportFileUpload() { | |
var isCompatible = false; | |
if (window.File && window.FileReader && window.FileList && window.Blob) { |
This file contains 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
<div id="dvImportSegments" class="fileupload "> | |
<fieldset> | |
<legend>Upload your CSV File</legend> | |
<input type="file" name="File Upload" id="txtFileUpload" accept=".csv" /> | |
</fieldset> | |
</div> |
This file contains 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 bool UpdateUser(User user) | |
{ | |
var existingUser = this.GetUser(user.Username); | |
if (existingUser == null) | |
{ | |
return false; | |
} | |
existingUser.CopyValues(user); | |
UnitOfWork.UserRepository.Update(existingUser); | |
UnitOfWork.Save(); |
This file contains 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 virtual void Update(TEntity entityToUpdate) | |
{ | |
var entry = this.context.Entry(entityToUpdate); | |
this.databaseSet.Attach(entityToUpdate); | |
entry.State = EntityState.Modified; | |
} |
OlderNewer