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
// This works | |
public class Users_ContractCharges : AbstractIndexCreationTask | |
{ | |
public override IndexDefinition CreateIndexDefinition() | |
{ | |
return new IndexDefinition<User, User>() | |
{ | |
Map = results => from user in results select new { user.Id }, | |
TransformResults = (database, results) => from user in results | |
from charges in user.Contract.Charges |
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
var refs = from p in entityInstance.GetType().GetProperties() | |
where | |
p.PropertyType.IsGenericType && | |
p.PropertyType.GetGenericTypeDefinition() == typeof(DenormalizedReference<>) | |
select p; | |
var result = new JArray(); | |
foreach (var p in refs) | |
{ |
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 class EntitySignatureIndexGenerator | |
{ | |
private readonly IDocumentStore documentStore; | |
public EntitySignatureIndexGenerator(IDocumentStore documentStore) | |
{ | |
this.documentStore = documentStore; | |
} | |
public bool CreateIndexForAssembly(Assembly targetAssembly) |
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 class EnsureHelper | |
{ | |
private const string EnsureUniqueConstraint = "Ensure-Unique-Constraint"; | |
public static IList<PropertyInfo> GetPropertiesFromMetadata(JObject metadata) | |
{ | |
var clrType = metadata.Value<string>("Raven-Clr-Type"); | |
if (clrType != null) | |
{ |
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 class RavenHelpers | |
{ | |
public static int ToIntId(this string id) | |
{ | |
return int.Parse(id.Substring(id.LastIndexOf('/') + 1)); | |
} | |
} |
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 class UserProfile | |
{ | |
public string Id { get; set; } | |
public string Name { get; set; } | |
public string Hometown { get; set; } | |
public DateTime FromDate { get; set; } |
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 class ReturnPartialIfAjaxAttribute : ActionFilterAttribute | |
{ | |
private readonly string partialViewName; | |
public ReturnPartialIfAjaxAttribute(string partialViewName) | |
{ | |
this.partialViewName = partialViewName; | |
} | |
public override void OnActionExecuted(ActionExecutedContext filterContext) |
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 class RavenMemoryBaseTest : RavenBaseTest { | |
protected override void ModifyConfiguration(Raven.Database.Config.RavenConfiguration configuration) | |
{ | |
configuration.RunInMemory = true; | |
} | |
protected override void ModifyStore(EmbeddableDocumentStore documentStore) | |
{ | |
documentStore.RegisterListener(new NonStaleQueriesListener()); | |
} |
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.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Raven.Tests.Helpers; | |
using Xunit; | |
namespace Raven.Tests | |
{ |
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.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Raven.Tests.Helpers; | |
using Xunit; | |
namespace ClassLibrary4 | |
{ |
OlderNewer