Pergunta

I have been trying to implement Cascading in my MVC application. Seems like everything is setup properly, but child docs are not being deleted. Does the metadata on the parent suppose to have a list of "Id"? If so this is what I have. Also how do I know if I am even using the plugin (Can I tell in Raven Studio)? Thanks for any help.

public class Album
{//What property is the meta data looking for to delete the children?
 public Guid ID {get;set;}
public string Id{get;set;}
public string AlbumName{get;set;}
}
public class Photo
{
public Guid ID{get;set;}
public string Id{get;set;}
public string photoName{get;set}
public string AlbumID{get;set}//Was told to add this so cascading would work
public Album{get;set;}
}

Replication

  1. Download latest version of Raven and unzipped
  2. Ran the start cmd in root of folder (made sure that cascade dll was in bundle folder)
  3. Created an album doc
  4. Created a photo doc
  5. Step 4 created a relationship key in the Album doc metadata (look below)
  6. Deleted the Album document(Should have deleted photo docs but didnt)

METADATA (Photos/449 is the Id of the photo doc)

{
  "Content-Type": "application/json; charset=utf-8",
  "Raven-Entity-Name": "Albums",
  "Raven-Clr-Type": "Declarations.Entities.Album, Declarations",
  "Raven-Cascade-Delete-Documents": [
    "Photos/449"
  ]
}

NOTE: I do have a ID property that is a Guid on both parent and child, could that cause issue?

Foi útil?

Solução

I was missing the sub folder plugins in the Server folder.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top