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 MyProject.Models; | |
using System.Data.Entity; | |
using System.Data.Entity.ModelConfiguration.Conventions; | |
namespace MyProject.Database | |
{ | |
public class ArchiveDatabase : DbContext | |
{ | |
// add a connection string in Web.config | |
// <add name="MyConnection" connectionString="Server=localhost;Database=MyDatabase;Trusted_Connection=true;" providerName="System.Data.SQLClient" /> |
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.Data.Entity; | |
using System.Linq; | |
namespace MyProject.Repositories | |
{ | |
public class EfRepository<T> : IRepository<T> | |
where T : class | |
{ | |
protected DbContext Context; |
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.Data.Entity; | |
using MyProject.Models; | |
namespace MyProject.Database | |
{ | |
public class MyDatabase : DbContext | |
{ | |
// add a connection string in Web.config | |
// <add name="MyConnection" connectionString="Server=localhost;Database=MyDatabase;Trusted_Connection=true;" providerName="System.Data.SQLClient" /> | |
public MyDatabase() : base("MyConnection") { } |
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
<?php | |
// This example uses a fork of the OAuthSimple library for PHP | |
// found here: https://github.com/tonefolder/oauthsimple/tree/master/php | |
// | |
// For more information about the OAuth process for applications | |
// accessing Discogs API, read: | |
// http://www.discogs.com/developers | |
require 'oauth.php'; | |
$oauthObject = new OAuthSimple(); | |
$scope = 'http://api.discogs.com'; |
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
<?php | |
$url = "http://api.discogs.com/"; // add the resource info to the url. Ex. releases/1 | |
//initialize the session | |
$ch = curl_init(); | |
//Set the User-Agent Identifier | |
curl_setopt($ch, CURLOPT_USERAGENT, 'YOUR_APP_NAME_HERE/0.1 +http://your-site-here.com'); |