Skip to content

Instantly share code, notes, and snippets.

<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
<link href="~/Content/bootstrapStars.css" rel="stylesheet" />
<div class="stars">
<form action="">
<input class="star star-5" id="star-5" type="radio" name="star"/>
<label class="star star-5" for="star-5"></label>
<input class="star star-4" id="star-4" type="radio" name="star"/>
<label class="star star-4" for="star-4"></label>
<input class="star star-3" id="star-3" type="radio" name="star"/>
<label class="star star-3" for="star-3"></label>
INSERT INTO
GOOD0001 (STOREID, GOODUC, DOCUMENTTYPE, DOCUMENTID, DOCUMENTITEM, GOODID, STATE, INVOICEID,
INVOICEITEM, TOTAL, GOODSTATE, PRICE, FITDATE_MIN, FITDATE_MAX, INVOICEDATE, BANLABOR, OFFICEINVOICETYPE)
VALUES (40, '09011', 0, 0, 0, 282161, 6, 0, 0, 392, 0, 3.23, '2018-01-01', '2018-01-01', '2016-04-20', 0, 1);
namespace PVT.Q1._2017.Shop.Tests
{
using System.Collections.ObjectModel;
using System.Web.Mvc;
using global::Moq;
using global::Shop.Common.Models;
using global::Shop.DAL.Infrastruture;
public Mock<IAlbumRepository> GetAlbumRepoMoq()
{
var albumRepo = new Mock<IAlbumRepository>();
albumRepo.Setup(m => m.GetAll(It.IsAny<Expression<Func<Album, BaseEntity>>>()))
.Returns(
new List<Album>()
{
new Album()
{
Id = 1,
[TestMethod]
public void TestAlbumListByArtistId()
{
var mockAlbumRepo = new Mock<IAlbumRepository>();
mockAlbumRepo.Setup(m => m.GetAll(It.IsAny<Expression<Func<Album, BaseEntity>>>()))
.Returns(
new List<Album>()
{
new Album()
{
[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(PVT.Q1._2017.Shop.App_Start.NinjectWebCommon), "Start")]
[assembly: WebActivatorEx.ApplicationShutdownMethodAttribute(typeof(PVT.Q1._2017.Shop.App_Start.NinjectWebCommon), "Stop")]
namespace PVT.Q1._2017.Shop.App_Start
{
using System;
using System.Web;
using Microsoft.Web.Infrastructure.DynamicModuleHelper;
namespace Shop.DAL.Repositories
{
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using Infrastructure.Models;
using Infrastructure.Repositories;
{
using System;
using System.Collections.Generic;
using Infrastructure.Models;
/// <summary>
/// The track.
/// </summary>
public class Track : BaseEntity
{
@forenheith
forenheith / ex
Created February 16, 2017 06:53
to linq
foreach (var pair in list)
{
try
{
var track = new Track { Artist = pair.Key, Name = pair.Value, Genre = "Pop", Year = "2017" };
var artist = new Artist() { Name = pair.Key };
// Add tracks to db
tracksSet.Add(track);
return (from vote in dataset.VotesSet
where vote.TrackId == song.Id
let user = userRepo.Find(vote.UserId)
select new UserVote(vote.Id, user, song, vote.Mark, vote.Comments)).ToList();