view

“view” is a reference object for views generated by using a zref file. The properties of this object type which are predefined in Zontroy are accessible and as follows:

name: name of a view
targetName: target name of a view set by the developer
alternativeName: alternative name of a view set by the developer
label: label of a view
primaryKey: short version of primaryKey.name
primaryKey.dataType: data type of primary key column
displayColumn: short version of displayColumn.name
displayColumn.dataType: data type of display column
extra1: extra field for custom data
extra2: extra field for custom data
extra3: extra field for custom data

 

Sample Implementation

Input

// I[[[view.name]]]Service.java.zref

import java.util.List;
public interface I[[[view.name]]]Service
{
public partial interface I[[[view.name]]]Service
{
List<[[[view.name]]]> GetAll();

[[[view.name]]] Get([[[view.primaryKeyDataType]]] [[[view.primaryKey]]]);
}
}

Output

// IProductsService.java
import java.util.List;
public interface IProductsService
{
List<Products> GetAll();

Products Get(int ProductID);
}

// ICategoriesService.java
import java.util.List;
public interface ICategoriesService
{
List<Categories> GetAll();

Categories Get(int CategoryID);
}

// IOrdersService.java
import java.util.List;
public interface IOrdersService
{
List<Orders> GetAll();

Orders Get(int OrderID);
}

Input

// I[[[view.name]]]Service.cs.zref
using System;
using System.ServiceModel;
using System.Collections.Generic;
using MyProject.Entities.Concrete;
namespace MyProject.Business.Abstract
{
[ServiceContract]
public partial interface I[[[view.name]]]Service
{
[OperationContract]
List<[[[view.name]]]> GetAll();
[OperationContract]
[[[view.name]]] Get([[[view.primaryKeyDataType]]] [[[view.primaryKey]]]);
}
}

Output

// IProductsService.cs

using System;
using System.ServiceModel;
using System.Collections.Generic;
using MyProject.Entities.Concrete;
namespace MyProject.Business.Abstract
{
[ServiceContract]
public partial interface IProductsService
{
[OperationContract]
List<Products> GetAll();
[OperationContract]
Products Get(int ProductID);
}
}

// ICategoriesService.cs
using System;
using System.ServiceModel;
using System.Collections.Generic;
using MyProject.Entities.Concrete;
namespace MyProject.Business.Abstract
{
[ServiceContract]
public partial interface ICategoriesService
{
[OperationContract]
List<Categories> GetAll();
[OperationContract]
Categories Get(int CategoryID);
}
}

// IOrdersService.cs
using System;
using System.ServiceModel;
using System.Collections.Generic;
using MyProject.Entities.Concrete;
namespace MyProject.Business.Abstract
{
[ServiceContract]
public partial interface IOrdersService
{
[OperationContract]
List<Orders> GetAll();
[OperationContract]
Orders Get(int OrderID);
}
}