I have a generic class in my project with derived classes.
public class GenericClass<T> : GenericInterface<T>
{
}
public class Test : GenericClass
I have a generic class in my project with derived classes.
public class GenericClass<T> : GenericInterface<T>
{
}
public class Test : GenericClass
In the webconfig, add following two:
<configuration>
<system.web>
<!--unit in kb-->
<!-- default 4096 -> 4MB -->
var jq = document.createElement('script'); | |
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
// ... give time for script to load, then type. | |
jQuery.noConflict(); |
DECLARE @fromDepartmentId int; | |
DECLARE @toDepartmentId int; | |
SET @fromDepartmentId = $fromDepartmentId; -- set 來源copy的單位 - 以我們例子就是單位A | |
SET @toDepartmentId = $departmentId; -- set 要被copy的單位 - 以我們例子就是單位B | |
INSERT INTO Department2NodePermission (DepartmentId, NodeId, Permission) | |
SELECT | |
@toDepartmentId, | |
[NodeId], |
This script is a suggestion from the umbraco community for creating index for tables.
The main script came from:
This is a bit dirty...but I need to mess with the database
Other similar topics:
using System; | |
using System.Data.Entity.Core.Objects; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Text; | |
namespace Fenton.Example | |
{ | |
public static class IQueryableExtensions | |
{ |
public static double WeightedAverage<T>(this IEnumerable<T> records, Func<T, double> value, Func<T, double> weight) | |
{ | |
double weightedValueSum = records.Sum(x => value(x) * weight(x)); | |
double weightSum = records.Sum(x => weight(x)); | |
if (weightSum != 0) | |
return weightedValueSum / weightSum; | |
else | |
throw new DivideByZeroException("Your message here"); | |
} |
public class Global : HttpApplication | |
{ | |
public void Application_Start() | |
{ | |
// Clears all previously registered view engines. | |
ViewEngines.Engines.Clear(); | |
// Registers our Razor C# specific view engine. | |
// This can also be registered using dependency injection through the new IDependencyResolver interface. | |
ViewEngines.Engines.Add(new RazorViewEngine()); |
Source:Get current node as IPublishedContent
var currentNode = UmbracoContext.Current.PublishedContentRequest.PublishedContent;
Or
UmbracoHelper umbracoHelper = new UmbracoHelper(UmbracoContext.Current);