private void WriteBodyGetByAttributes(IEntity entity, IAttributes attributes) { cw.WriteLine("{0} {1} = WebClientFactory.GetJsonClient()", NamingHelperStack.ToDTOTypeName(entity, dtoEnvironment), VarName_DTO); cw.Indent++; cw.WriteLine(".Get<{0}>(String.Format(\"/{1}/{2}\", {3}))", NamingHelperStack.ToServiceResponseName(entity, interfacesEnvironment), NamingHelperStack.ToServiceName(entity, null), cw.ToSeparatedString(attributes.ToList(), "/", delegate(object item, int count) { return(String.Format("{0}/{{{1}}}", (item as IAttribute).Name, count)); }), environment.ToArguments(attributes) ); cw.WriteLine(".{0};", NamingHelper.ToDTOPropertyName(entity)); cw.Indent--; cw.WriteLine("return {0} == null ? null : new {1}({0});", VarName_DTO, NamingHelperStack.ToDTOAdapterTypeName(entity, null)); }